Regex Playground

Write, test, and debug regular expressions with instant visual matching and explanations.

/ /
0 matches 0ms

📖 Regex Cheatsheet

Character Classes

. Any character
\d Digit [0-9]
\w Word char [a-zA-Z0-9_]
\s Whitespace
[abc] Any of a, b, c
[^abc] Not a, b, or c
[a-z] Range a to z

Quantifiers

* 0 or more
+ 1 or more
? 0 or 1
{n} Exactly n
{n,m} Between n and m
*? Lazy (minimal)

Anchors & Groups

^ Start of string
$ End of string
\b Word boundary
(abc) Capture group
(?:abc) Non-capture group
a|b Alternation (or)
(?=abc) Lookahead

Flags

g Global search
i Case insensitive
m Multiline
s Dotall (. matches \n)
u Unicode

📂 Common Patterns