Below you will find pages that utilize the taxonomy term “pcre”
April 5, 2011
Linux环境下PCRE库的使用
"今天下载了PCRE的正则表达式库,应用在Linux环境下的C语言编程中。\n调用方法:\n1.下载PCRE库:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/,版本是7.8;\n2.解压后执行configure,而后make,make install,可配置后动态链接库;\n3.写了个测试的例子:\n#include\n#include\nint main()\n{\npcre *re;\nconst char *error;\nint erroffset;\nint rc;\nint ovector[30];\nre = pcre_compile(“some”, 0, \u0026amp;error, \u0026amp;erroffset, NULL);\nrc = pcre_exec(re, NULL, “some string”, 11, 0, 0, ovector, 30);\nprintf(“%d\\n”, rc);\nreturn 0;\n}\n4.gcc -o test test.c -lpcre\n5../test\n6.参考文档:\n上述有很多细节要搞清楚,还需要仔细研 …"