>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:
PG> Hi,
PG> when I use setup_regexp_matches, I found matchctx->npatterns is
PG> always 1 no matter pattern have not or one subexpr subexpression.
This isn't a bug. setup_regexp_matches is just an internal helper
function for use by regexp_match, regexp_matches, regexp_split_to_table,
and regexp_split_to_array, all of which treat the whole match as the
result if there are no subexpression captures in the regexp. npatterns
is therefore forced to be 1 in that case, so that nmatches * npatterns
is the number of position pairs returned in the match_locs array.
--
Andrew (irc:RhodiumToad)