Developer Utilities regex developer text
Browse All Tools

Regex Tester & Playground

Write a pattern and watch it match as you type, highlighted in place, with every capture group laid out by number and by name. Group references work in the replacement preview, so you can build the replacement string with the same instant feedback. The part that makes an unfamiliar regex readable is the breakdown: every token explained in plain English, one piece at a time. And it runs the match off the main thread, so a pattern that backtracks catastrophically — which is easy to write by accident and exactly what you opened a tester to discover — gets abandoned with an explanation instead of freezing the tab and taking your work with it. Everything runs in your browser.

This tool does not use any data storage or network traffic.

/ / g

Matches highlighted

Matches


What this pattern says


Result

Start from an example


Cheat sheet


. any character except newline
\d a digit
\D not a digit
\w letter, digit or underscore
\W none of those
\s whitespace
\S not whitespace
\b word boundary
^ start of string or line
$ end of string or line
[abc] any one of a, b or c
[^abc] anything except those
[a-z] any character in the range
a* zero or more
a+ one or more
a? zero or one
a{3} exactly three
a{2,5} between two and five
a+? one or more, lazily
(…) capture group
(?:…) group without capturing
(?<n>…) group named n
(?=…) followed by
(?!…) not followed by
a|b a or b

Nothing leaves your browser


Matching happens locally, in a background thread so a slow pattern cannot freeze the page. Your pattern and test string are never uploaded and never stored.