int ret;
pm = pcre2_match_data_create_from_pattern(preg->reg, NULL);
- ret = pcre2_match(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)strlen(subject),
+ ret = preg->mfn(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)strlen(subject),
0, 0, pm, NULL);
pcre2_match_data_free(pm);
if (ret < 0)
int ret;
pm = pcre2_match_data_create_from_pattern(preg->reg, NULL);
- ret = pcre2_match(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)length,
+ ret = preg->mfn(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)length,
0, 0, pm, NULL);
pcre2_match_data_free(pm);
if (ret < 0)
*/
#ifdef USE_PCRE2
pm = pcre2_match_data_create_from_pattern(preg->reg, NULL);
- ret = pcre2_match(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)strlen(subject), 0, options, pm, NULL);
+ ret = preg->mfn(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)strlen(subject), 0, options, pm, NULL);
if (ret < 0) {
pcre2_match_data_free(pm);
options |= PCRE_NOTBOL;
#endif
- /* The value returned by pcre_exec()/pcre2_match() is one more than the highest numbered
+ /* The value returned by pcre_exec()/pcre2_(jit)_match() is one more than the highest numbered
* pair that has been set. For example, if two substrings have been captured,
* the returned value is 3. If there are no capturing subpatterns, the return
* value from a successful match is 1, indicating that just the first pair of
*/
#ifdef USE_PCRE2
pm = pcre2_match_data_create_from_pattern(preg->reg, NULL);
- ret = pcre2_match(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)length, 0, options, pm, NULL);
+ ret = preg->mfn(preg->reg, (PCRE2_SPTR)subject, (PCRE2_SIZE)length, 0, options, pm, NULL);
if (ret < 0) {
pcre2_match_data_free(pm);
goto out_fail_alloc;
}
+ regex->mfn = &pcre2_match;
#if defined(USE_PCRE2_JIT)
jit = pcre2_jit_compile(regex->reg, PCRE2_JIT_COMPLETE);
/*
pcre2_code_free(regex->reg);
memprintf(err, "regex '%s' jit compilation failed", str);
goto out_fail_alloc;
+ } else {
+ regex->mfn = &pcre2_jit_match;
}
#endif