Skip to main content

Regex Replace Tester

Press Match or Ctrl/⌘+Enter to see the result.

Groups: 3
Everything is processed in your browser. Nothing is uploaded.

About this tool: Regex Replace Tester

Search-and-replace with regular expressions lets you restructure text using capture groups. Enter a pattern and a replacement, and the result updates live so you can refine it before running it in an editor or script.

Common uses

  • Building a validation pattern before putting it in code
  • Writing a find-and-replace using capture groups
  • Understanding a regular expression someone else wrote

Frequently asked questions

How do I reuse a matched group?
Write $1 for the first group, $2 for the second, or $<name> for a named group.
How do I replace every match?
Turn on the g flag. Without it only the first match is replaced.