Skip to main content

Text

Regex Tester

Test JavaScript regular expressions against your text with live highlighting. Inspect every match and its numbered or named groups, and preview what a replacement produces.

Runs in your browser. Nothing is uploaded.
Don't know the pattern yet? Highlight examples in your text and let the Regex Builder write it for you.
//

Matches
Match details
Result
As code
Cheat sheet
.any char except newline
\d \w \sdigit, word char, whitespace
\D \W \Snegated versions
\bword boundary
^ $start / end (of line with m)
[abc] [^abc]set / negated set
[a-z]range
a* a+ a?0+, 1+, 0 or 1
a{2,5}between 2 and 5
a*? a+?lazy (as few as possible)
(abc)capture group
(?<name>abc)named group
(?:abc)non-capturing group
\1 \k<name>backreference
a|balternation
(?=a) (?!a)lookahead
(?<=a) (?<!a)lookbehind
\p{L} \p{Emoji}Unicode property (u flag)
esc