Regex tester

Write a regular expression and see every match highlighted as you type. Inspect capture groups, try the flags and preview a replacement.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Write the patternType the expression without slashes and choose the flags.
  2. Add test textPaste the text you want to search. Matches are highlighted.
  3. Check groups and replaceSee the groups table and preview a replacement.

See what your pattern really matches

Regular expressions are easy to get almost right. Highlighting every match in the text shows at once whether a pattern is too greedy, misses a case or matches across lines. The groups table lists each match with its position and capture groups, including named groups, so you can check exactly what your code will receive.

The tester uses the JavaScript engine of your browser, so results match Node.js and every modern browser, including Unicode property escapes like \p{L} with the u flag.

No frozen tabs

Some patterns take exponential time on certain inputs, known as catastrophic backtracking. Here the matching runs in a background worker and is stopped after 1.5 seconds with a clear message, so a bad pattern cannot lock up the page. Your text never leaves your device.

Frequently asked questions

Which regex flavor is used?

JavaScript (ECMAScript), as in browsers and Node.js. Most syntax is shared with PCRE, Python and Java, but lookbehind and some escapes differ.

How do I use groups in the replacement?

Use $1, $2 for numbered groups, $<name> for named groups and $& for the whole match.

Why does the tool say the pattern is too slow?

The pattern backtracks heavily on this text. Make quantifiers more specific or avoid nested repeats like (a+)+.

Is my text uploaded?

No. Everything runs in your browser.