Regex Tester

Write a pattern, see every match highlighted live, and inspect each capture group — nothing you type ever leaves your browser.

/ /g
Try an example:
Matches will be highlighted here.

Matches

Quick reference

The most common tokens, in case you need a refresher.

Character classes
. any character except line break
\d digit — \D non-digit
\w word char — \W non-word
\s whitespace — \S non-whitespace
[abc] any of a, b, c
[^abc] none of a, b, c
[a-z] range a to z
Anchors & boundaries
^ start of string / line
$ end of string / line
\b word boundary — \B not
Quantifiers
* 0 or more — + 1 or more
? 0 or 1
{n} exactly n
{n,} n or more
{n,m} between n and m
*? lazy (fewest possible)
Groups & alternation
(...) capturing group
(?:...) non-capturing group
(?<name>...) named group
a|b a or b
(?=...) lookahead
(?!...) negative lookahead
Matching runs entirely in your browser's own regex engine. Nothing you type is ever sent anywhere. Very complex patterns on very long text can be slow to evaluate — that's true of any regex engine, not just this one.