Class Builder
Common patterns
Build my own
URL slug
Username
Hexadecimal
Alphanumeric
Code identifier
Safe filename
Whitespace
Punctuation
Unicode letters (any script)
Emoji
Non-ASCII
Character ranges
Additional literal characters
Type them plainly —
]
,
\
,
^
and
-
are escaped and positioned correctly for you.
Custom ranges
Comma-separated
start-end
pairs.
Shorthand classes
Unicode properties
(needs the u flag)
Negate the class
Matches everything
except
these characters —
[^…]
.
Quantifier
None — single character
? — optional (0 or 1)
* — zero or more
+ — one or more
{n,m} — exact range
Greediness
Greedy (default)
Lazy (?)
Min
Max (blank = unlimited)
Anchors & flags
Anchor whole string ^…$
Wrap in a group
g — global
i — ignore case
m — multiline
u — unicode
Pattern
Pattern
Live tester
Cheat sheet
pattern.txt
Copy
Copy class only
Download
Test string
Hello World_123! user-name@example.com Ünïcödé tëxt — 2026 spaces and tabs