Text & Regex

Regex Replacement Tester

Enter a pattern and replacement, paste your sample text, and see every match replaced as you type. Capture groups, named groups, and flags are all supported — and your text never leaves the page.

Runs in your browser v1.0.0

Pattern & replacement

live
Flags

Reference capture groups with $1, $2…, the whole match with $&, and named groups with $<name>. Use $$ for a literal dollar sign.

Sample text

input

Matches are found against this text. Only the first match is replaced unless the g flag is on.

Result

replaced

Read-only result. Copy or download it with the buttons above.

Matches & capture groups

0 matches

How it works

Your pattern is compiled with the browser’s own RegExp engine and applied with String.prototype.replace, so the behaviour matches exactly what your JavaScript will do. The matches panel lists every match and capture group that the replacement touches. Invalid patterns show the engine’s message instead of breaking the page, and everything runs locally in your browser — no text is uploaded.