Options for XRegExp Regular Expressions


OptionDescriptionBackend valuePortable value
nNamed capture onlyexplicitcapture(not portable)
sDot matches all (singleline)dotalldotall
xFree-spacing and line comments (extended)commentcomments
A21-bit Unicode properties (astral) — Requires the Unicode Base addonastral(not portable)
gAll matches, or advance lastIndex after matches (global)global(not portable)
iCase insensitive (ignoreCase)ignorecaseignorecase
m^ and $ match at newlines (multiline)multilinemultiline
yMatches must start at lastIndex (sticky) — Requires Firefox 3+ or native ES6 supportsticky(not portable)
XRegExp provides four new flags (n, s, x, A), which can be combined with native flags and arranged in any order. Unlike native flags, non-native flags do not show up as properties on regular expression objects.