NAME
regexp_match - perform regular expression matching
SYNOPSIS
varargs int *regexp_match(string *pattern, string subject, int reverse)
DESCRIPTION
The argument subject is matched against the compiled regular
expression pattern. If the argument reverse is nonzero, matching
is performed from right-to-left; otherwise, matching is performed
left-to-right.
The pattern argument must be an array of strings exactly as it
was received from regexp_compile(); otherwise, the result of
calling this function is undefined.
If the argument subject could not be matched with the regular
expression, 0 is returned. Otherwise, an array of 20 integers
is returned with this format:
({ start0, end0, start1, end1, ..., start9, end9 })
Each element is a character index into the subject string. The
first two elements, start0 and end0, indicate the part of the subject
that was matched by the regular expression as a whole. The following
elements indicate the starting and ending indices of each
subexpression (denoted by "%(" and "%)" pairs in the original
pattern) that were matched.
If any subexpression was not matched, the corresponding start and
end elements will be 0 and -1, respectively.
SEE ALSO
kfun/regexp_compile