Regex Cheat Sheet Generator

Quick reference guide for common regular expression patterns.

← Back Home

Character Classes

\d
Digit (0-9)
\D
Non digit
\w
Word character
\W
Non word character
\s
Whitespace
\S
Non whitespace
.
Any character except newline

Anchors

^
Start of string
$
End of string
\b
Word boundary
\B
Non word boundary

Quantifiers

*
0 or more
+
1 or more
?
0 or 1
{n}
Exactly n times
{n,}
n or more times
{n,m}
Between n and m times

Groups and Ranges

(abc)
Capture group
(?:abc)
Non capturing group
[abc]
Any of a, b, or c
[^abc]
Not a, b, or c
a|b
a or b

Lookarounds

(?=abc)
Positive lookahead
(?!abc)
Negative lookahead
(?<=abc)
Positive lookbehind
(?<!abc)
Negative lookbehind

Make sure to bookmark this tool

Want quick access? Add this tool to our Home page under My Saved Tools.