match
Matches a compiled regular expression against a given subject string,
using a matching algorithm that is similar to Perl's. If the subject
string doesn't match the regular expression,
Nothing is
returned, otherwise the portion of the string that matched is
returned, along with any captured subpatterns.
The arguments are:
- regex, a PCRE regular expression value produced by
compile
- subject, the subject string to match against
- options, an optional set of exec-time flags to exec.
Available runtime options are:
- anchored - Match only at the first position
- bsr_anycrlf - '\R' matches only CR, LF, or CRLF
- bsr_unicode - '\R' matches all Unicode line endings
- newline_any - Recognize any Unicode newline sequence
- newline_anycrlf - Recognize CR, LF, and CRLF as newline
sequences
- newline_cr - Set CR as the newline sequence
- newline_crlf - Set CRLF as the newline sequence
- newline_lf - Set LF as the newline sequence
- notbol - Subject is not the beginning of a line
- noteol - Subject is not the end of a line
- notempty - An empty string is not a valid match
- no_utf8_check - Do not check the subject for UTF-8
- partial - Return PCRE_ERROR_PARTIAL for a partial
match
The result value, and any captured subpatterns, are returned. If the
regex is invalid, or the subject string is empty, Nothing is returned.