
regexp_matches
NAME
regexp_matches - find the substrings matched by a regular expression
SYNOPSIS
string *regexp_matches(string pattern, string subject, int case_insensitive)
DESCRIPTION
A regular expression pattern string is searched for within a subject
string. If a "match" is found then an array is constructed containing
the actual substrings of the subject string which matched the overall
regular expression and any subexpressions. The overall matching
substring is the first element of the array, with subexpressions
following in the order they appear in the pattern string. If there
is no match, a blank array is returned.
The presence of the optional case_insensitive flag means that the
search is done without regard to case.
EXAMPLES
regexp_matches("bcd", "abcde")
returns ({ "bcd" })
regexp_matches("xyz", "abcde") returns
({ })
regexp_matches("b\\([c]*\\)d", "abcccccde")
returns ({ "bcccccd", "ccccc" })
NOTES
The regular expression pattern may have at most nine subexpressions.
SEE ALSO
HTMLised 1998 Greg Lewis
(glewis@maths.adelaide.edu.au)