🔍 Regex Cheat Sheet & Tester

Complete regex reference with live testing. Pattern syntax, flags, character classes, quantifiers, and groups — all in one place.

/ /
Character Classes
. — Any character
\d — Digit [0-9]
\w — Word char [a-zA-Z0-9_]
\s — Whitespace
[abc] — a, b, or c
[^abc] — Not a, b, or c
[a-z] — Range a to z
Quantifiers
* — 0 or more
+ — 1 or more
? — 0 or 1
{3} — Exactly 3
{3,} — 3 or more
{3,6} — Between 3 and 6
Anchors & Groups
^ — Start of string
$ — End of string
(...) — Capture group
(?:...) — Non-capture
(?=...) — Lookahead
\1 — Backreference
Flags
g — Global (all matches)
i — Case insensitive
m — Multiline
s — Dot matches newline
u — Unicode