Static Readonlyalphanumeric\w,
Matches any alphanumeric character including the underscore.
Static Readonlyany.,
Matches any single character except the newline character, by default.
Alias of dot.
Static Readonlyasterisk*,
Matches the preceding expression 0 or more times. Equivalent to {0,}.
Static Readonlybackslash``, backslash.
Static Readonlybackspace[\b],
Matches a backspace (U+0008).
Static Readonlybegin^,
Matches beginning of input.
If the multiline flag is set to true, also matches immediately after a line break character.
@see: Caret
Static Readonlycarriage\r,
Matches a carriage return (U+000D).
Static Readonlycasei,
Case-insensitive search.
Static Readonlydigit\d, Matches a digit character. Equivalent to [0 - 9].
Static Readonlydot.,
Matches any single character except the newline character, by default.
Static Readonlydots,
Allows . to match newline characters.
Static Readonlyend$,
Matches end of input.
If the multiline flag is set to true, also matches immediately before a line break character.
Static Readonlyformfeed\f,
Matches a form feed (U+000C).
Static Readonlyglobalg,
Global search.
Static Readonlylinefeed\n,
Matches a line feed (U+000A).
Static Readonlymore*,
Matches the preceding expression 0 or more times. Equivalent to {0,}.
Alias of asterisk.
Static Readonlymultiplem,
Multi-line search.
Static Readonlynon\D, Matches a non-digit character. Equivalent to [^ 0 - 9].
Static Readonlynon\S,
Matches a character other than white space.
Static Readonlynon\W,
Matches any non-word character.
Static Readonlynon\B, Matches a non-word boundary.
Static Readonlynull\0, Matches a NULL (U+0000) character.
Static Readonlyone+,
Matches the preceding expression 1 or more times. Equivalent to {1,}.
Alias of plus.
Static Readonlyplus+,
Matches the preceding expression 1 or more times. Equivalent to {1,}.
Static Readonlyquestionmark?,
Matches the preceding expression 0 or 1 time. Equivalent to {0,1}.
Static Readonlystickyy,
Perform a "sticky" search that matches starting at the current position in the target string.
Static Readonlystrickyy,
Perform a "sticky" search that matches starting at the current position in the target string.
Alias of stickySearchFlag, kept for backward compatibility.
Use stickySearchFlag instead.
Static Readonlytab\t,
Matches a tab (U+0009).
Static Readonlyunicodeu,
"unicode"; treat a pattern as a sequence of unicode code points.
Static Readonlyvertical\v,
Matches a vertical tab (U+000B).
Static Readonlywhitespace\s,
Matches a white space character, including space, tab, form feed, line feed.
Static Readonlyword\b
Matches a word boundary.
Static Readonlyzero?,
Matches the preceding expression 0 or 1 time. Equivalent to {0,1}.
Alias of questionmark.
Staticbackreference\n,
Where n is a positive integer,
a back reference to the last substring matching the n parenthetical
in the regular expression (counting left parentheses).
Staticcapturing(x), Matches x and remembers the match.
The parentheses are called capturing parentheses.
(?<name>x), Named capturing group: Matches x and stores it
on the groups property of the returned matches under the name specified by
expression
Optionalname: string
name
StaticcharacterStaticcontrolStatichexStaticlookaheadStaticlookbehindStaticnegated[^xyz],
A negated or complemented character set.
Staticnegatedx(?!y)
Matches x only if x is not followed by y.
This is called a negated lookahead.
expression
the not followed by expression
Staticnegated(?<!y)x,
Matches x only if x is not preceded by y.
This is called a negated lookbehind.
expression
the not preceded by expression
Staticnon(?:x), Matches x but does not remember the match.
The parentheses are called non-capturing parentheses.
expression
StaticoccurrenceStaticoccurrence{n,}, {n,m},
Matches at least n occurrences of the preceding expression. N must be a positive integer.
Where n and m are positive integers and n <= m.
Matches at least n and at most m occurrences of the preceding expression.
When m is omitted, it's treated as ∞.
at least occurrences
Optionalm: number
(optional) at most occurrences
StaticorStaticunicode\uhhhh
Matches the character with the code hhhh.
four hexadecimal digits
Staticunicode\u{hhhh}
(only when u flag is set)
Matches the character with the Unicode value hhhh (hexadecimal digits).
four hexadecimal digits
Regular Expression Specification
See
Regular Expressions