RegEx Syntax & Token ReferenceStandard JavaScript regular expression tokens, quantifiers, anchors, and assertions.
Anchors matching the beginning (^) and end ($) of the input string or line.
^start.*end$
Character classes: \d (digit 0-9), \w (alphanumeric/underscore), \s (whitespace).
\d{3}-\d{4}
Quantifiers: * (0 or more), + (1 or more), ? (0 or 1 optional).
a*b+c?
Non-capturing group: groups tokens together without creating a capture index.
(?:https?|ftp)
Named capture group: captures matched substring accessible by name.
(?<year>\d{4})
Positive lookahead: asserts that what immediately follows matches pattern.
\d+(?=px)
Protection against exponential catastrophic backtracking on nested quantifiers.
(a+)+$