.* Regex Tester

// live highlighting · named groups · flag toggles · ReDoS protection

All regex matching runs entirely in your browser. Your patterns and test strings never leave your device.
/ /
No pattern
Quick reference
Character classes
. Any char except newline (use s flag for newlines)
\w Word char [a-zA-Z0-9_]
\d Digit [0-9]
\s Whitespace (space, tab, newline…)
\W \D \S Negated versions of above
[abc] Character set — any of a, b, or c
[^abc] Negated set — anything except a, b, c
[a-z] Character range
Anchors & boundaries
^ Start of string (or line with m flag)
$ End of string (or line with m flag)
\b Word boundary
\B Non-word boundary
Quantifiers
* 0 or more (greedy)
+ 1 or more (greedy)
? 0 or 1 (greedy)
{n,m} Between n and m occurrences
*? +? ?? Lazy (non-greedy) versions
Groups & lookaround
(abc) Capturing group
(?:abc) Non-capturing group
(?<name>abc) Named capturing group
(?=abc) Lookahead — followed by abc
(?!abc) Negative lookahead
(?<=abc) Lookbehind — preceded by abc
(?<!abc) Negative lookbehind
Flags (click to toggle above)
g Global — find all matches, not just first
i Case-insensitive matching
m Multiline — ^ and $ match line starts/ends
s Dotall — dot matches newlines too
u Unicode — enables \p{} and full Unicode matching
Special sequences
\n \t \r Newline, tab, carriage return
\uXXXX Unicode code point
a|b Alternation — match a or b