28 uint32_t options = PCRE2_UTF;
32 if (!(re->
regex = pcre2_compile((PCRE2_SPTR)
pattern, PCRE2_ZERO_TERMINATED, options, &errorcode, &offset, NULL))) {
33 PCRE2_UCHAR buffer[256];
34 pcre2_get_error_message(errorcode, buffer,
sizeof(buffer));
35 ELOG(
"PCRE regular expression compilation failed at %lu: %s\n",
62 pcre2_match_data *match_data;
65 match_data = pcre2_match_data_create_from_pattern(
regex->
regex, NULL);
69 rc = pcre2_match(
regex->
regex, (PCRE2_SPTR)input, strlen(input), 0, 0, match_data, NULL);
70 pcre2_match_data_free(match_data);
72 LOG(
"Regular expression \"%s\" matches \"%s\"\n",
77 if (rc == PCRE2_ERROR_NOMATCH) {
78 LOG(
"Regular expression \"%s\" does not match \"%s\"\n",
83 ELOG(
"PCRE error %d while trying to use regular expression \"%s\" on input \"%s\", see pcreapi(3)\n",