BlueprintLab ReferenceWeb · Data

Regular expression cheat sheet

Quick reference for regex character classes, quantifiers, anchors, groups and flags.

ReferenceTools

Regex syntax differs by engine (JavaScript, PCRE, Python, RE2, etc.). This page uses JavaScript-style syntax as the baseline.

PatternMeaning
. Any char except line terminator (default)
\d Digit
\D Not a digit
\w Word character (engine-dependent Unicode behavior)
\s Whitespace
[abc] One of a/b/c
[^abc] Not a/b/c
^ Start
$ End
* 0 or more
+ 1 or more
? 0 or 1 / lazy modifier in some contexts
{n} Exactly n
{n,m} n to m
(abc) Capturing group
(?:abc) Non-capturing group
a|b Alternation
(?=x) Positive lookahead
(?!x) Negative lookahead

JavaScript flags

FlagMeaning
gglobal
iignore case
mmultiline
sdotAll
uUnicode mode
vUnicode sets mode (modern JS engines)
ysticky

Continue with a tool

Sources & update policy

Verified: 2026-08-31. This page prioritizes primary standards and official registries. Time-sensitive items should be rechecked against the linked source.