Regex Tester & Explainer

Test regular expressions with a live token-by-token pattern explainer, match highlighting, and optional replacement. JavaScript regex engine, 100% client-side.

//gm
3 matches found
john@example.com Jane Smith <jane@company.org> Invalid email: not-an-email Contact: contact@praticulus.com
#1
john@example.comat index 0
#2
jane@company.orgat index 29
#3
contact@praticulus.comat index 84
[a-z]character class: any character in [a-z]
+quantifier: 1 or more of the previous token
@literal "@"
[a-z]character class: any character in [a-z]
+quantifier: 1 or more of the previous token
\.literal "."
[a-z]character class: any character in [a-z]
+quantifier: 1 or more of the previous token
Regex Quick Reference

Characters

. Any character except newline
\d Digit [0-9]
\w Word [a-zA-Z0-9_]
\s Whitespace
\D Non-digit
\W Non-word
\S Non-whitespace
[abc] Set of characters
[^abc] Negated set

Quantifiers

* 0 or more
+ 1 or more
? 0 or 1
{n} Exactly n
{n,} n or more
{n,m} n to m
*? Lazy (non-greedy)

Anchors & Groups

^ Start of string/line
$ End of string/line
\b Word boundary
\B Non-word boundary
(abc) Capture group
(?:abc) Non-capturing group
(?=abc) Positive lookahead
(?!abc) Negative lookahead
(?<=abc) Pos. lookbehind
(?<!abc) Neg. lookbehind

Escape Sequences

\n Newline (LF)
\t Tab
\r Carriage return
\uXXXX Unicode escape
\xXX Hex escape
\1-\9 Backreference
\k<name> Named backref
\p{L} Unicode prop