- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
A string to be interpreted as a regular expression pattern.
A combination of zero or more single-letter flags specifying search options.
Reg object, and is equivalent to declaring a regular expression literal (such as
/ab+c/i) or calling the
Reg constructor (for example,
flags parameter can include any of the following options:
g(global match): match all occurrences of the pattern in a string, not just the first.
i(ignore case): perform case-insensitive search.
m(multiline): treat the
$regular expression tokens as matching the start or end of any line in a string (as delimited by newline or return characters), not just the start or end of the entire string.