Back to Developer
Regex tester — live match & replace preview

Regex tester — live match & replace preview

Type a pattern and flags to highlight matches in the test string in real time. Capture groups and named groups are listed for every match, and there's a replace preview using $1 etc. Runs entirely in your browser.

developerregextext

How to use

Type a pattern and flags (g / i / m / s / u / y) — matches in the test text are highlighted in real time, with capture groups and named groups listed per match. Switch to Replace mode for a live preview of replacements using $1, $<name>, etc. The Sample button loads a working example.

FAQ

Are pattern / text uploaded?
No. Everything is evaluated via the browser's RegExp locally.
Which regex flavor is it?
JavaScript (ECMAScript) RegExp. Differences from PCRE / Python re may apply (e.g. lookbehind and property escapes need recent browsers).
Can patterns hang the browser?
Catastrophic backtracking can freeze the tab. Be careful with deeply nested * / + quantifiers.
What does $& mean in Replace mode?
The same as String.replace: $& is the full match, $1+ are numbered captures, $<name> is a named capture.

Related tools