Skip to main content
Back to tools

Regex Cheatsheet

Reference common JavaScript regex syntax.

Scan common character classes, quantifiers, anchors, groups, and starter patterns.

Mode
Guide
Engine
JS
Status
Live

Character classes

\d
Digit
\w
Word character
\s
Whitespace
[^abc]
Not a, b, or c

Quantifiers

*
Zero or more
+
One or more
?
Zero or one
{2,5}
Between 2 and 5

Anchors and groups

^
Start of input or line
$
End of input or line
(abc)
Capture group
(?:abc)
Non-capturing group

Useful patterns

\b\w+@\w+\.\w+\b
Simple email shape
https?:\/\/\S+
HTTP URL
\b[0-9a-f]{8}\b
8-char hex fragment
^\s*$
Blank line