Regex Tester
Last updated:
Test a JavaScript regex against sample text — see every match highlighted, capture groups, or a live replace preview.
How it works
- Uses JavaScript’s own
RegExpengine — exactly what runs in your browser or a Node.js backend, so a pattern that works here works in your code without translation. - Match mode highlights every match in the test string and lists each one’s position, full text, and numbered/named capture groups.
- Replace mode runs
testString.replace(pattern, replacement)live — the replacement field supports backreferences like$1or$<name>for named groups. - Without the
g(global) flag, only the first match counts — the same behavior JavaScript’s own.replace()and.exec()have.
Runs entirely in your browser — nothing you type here is uploaded, logged, or stored. A pathological pattern (catastrophic backtracking) can freeze this tab the same way it would in your own devtools console; reload if that happens.