Toolkit
Regex Cheat Sheet
Quick reference for common regex tokens, quantifiers, and groups.
Basics
.Any character except newline
\dDigit [0-9]
\wWord char [A-Za-z0-9_]
\sWhitespace
^ / $Start / end of line
Quantifiers
*0 or more
+1 or more
?0 or 1
{m,n}Between m and n
Groups
(abc)Capture group
(?:abc)Non-capturing group
(?=abc)Positive lookahead
(?!abc)Negative lookahead
Character Classes
[abc]a or b or c
[^abc]Not a/b/c
[a-z]Range a to z
\bWord boundary
Flags
gGlobal
iIgnore case
mMultiline ^/$
sDot matches newline
Frequently Asked Questions
How to learn fast?
Pair this cheat sheet with the live Regex Tester to try patterns instantly.
Are these flavors specific?
These are common constructs that work in most JS regex engines.