1、PCRE库下载:
http://www.pcre.org/
2、编译和安装
http://blog.csdn.net/jollyjumper/article/details/5700024
http://www.cppblog.com/woaidongmao/archive/2009/09/07/95493.html
3、PCRE的使用实例
#include <..\pcre\include\pcre.h>
int _tmain(int argc, _TCHAR* argv[])
{
std::wstring sSrcReal = L"ahsf(agsh艾丝凡);asghjgah(ahsjhj);(&*(^&&*AS%Q(asg1asg); ajshfghasfg";
std::string sSrcRealUtf_8 = CW2A(sSrcReal.c_str(), CP_UTF8);
// 使用PCRE提取用户ID
std::string sRulesUtf_8 = CW2A(L"(?<=\\()[\\w\u4E00-\u9FFF]+(?=\\);)", CP_UTF8);
int nOptions = PCRE_EXTENDED | PCRE_UTF8;
const char *pError;
int nErroffset;
// 构造pcre结构