2 #define I3__FILE__ "regex.c"
26 int errorcode, offset;
30 int options = PCRE_UTF8;
36 while (!(re->
regex = pcre_compile2(pattern, options, &errorcode, &error, &offset, NULL))) {
39 if (errorcode == 32) {
40 options &= ~PCRE_UTF8;
43 ELOG(
"PCRE regular expression compilation failed at %d: %s\n",
52 ELOG(
"PCRE regular expression studying failed: %s\n", error);
80 if ((rc = pcre_exec(regex->
regex, regex->
extra, input, strlen(input), 0, 0, NULL, 0)) == 0) {
81 LOG(
"Regular expression \"%s\" matches \"%s\"\n",
86 if (rc == PCRE_ERROR_NOMATCH) {
87 LOG(
"Regular expression \"%s\" does not match \"%s\"\n",
92 ELOG(
"PCRE error %d while trying to use regular expression \"%s\" on input \"%s\", see pcreapi(3)\n",