- return (expand_setup < 0
- ? pcre_exec(re, NULL, CCS s, Ustrlen(s), 0, PCRE_EOPT, NULL, 0) >= 0
- : regex_match_and_setup(re, s, 0, expand_setup)
- )
- ? OK : FAIL;
+ if (expand_setup < 0
+ ? pcre_exec(re, NULL, CCS s, Ustrlen(s), 0, PCRE_EOPT, NULL, 0) < 0
+ : !regex_match_and_setup(re, s, 0, expand_setup)
+ )
+ return FAIL;
+ /* assume the above wrote $0, $n... TODO: CHECK THAT !! */
+ if (valueptr) *valueptr = pattern; /* "value" gets the RE */
+ return OK;