Regex Replace Tester

Preview

Result

Learn

Regex Replace Tester Guide

About this tool

Test a find-and-replace before running it. Enter a pattern, flags, a replacement string (with $1 group references) and sample text; the preview highlights matches and the result box shows the output.

Questions

Why do I get no replacements with a non-global flag?
Without g, only the first match is replaced. If you see none, check that the pattern matches the example text and does not have an invalid flag.