Skip to content
SnapTools

Find and Replace (Regex)

Runs in your browser

Find and replace text in a block of content — plain matching by default, or full regular expressions with capture groups when you need them.

About this tool

A find-and-replace that only handles literal strings runs out of usefulness fast: reformatting dates, stripping a recurring pattern, or renaming across inconsistent casing all need something more expressive. This tool defaults to safe literal matching, and switches to full JavaScript regular expressions — including capture groups referenced as $1, $2 in the replacement — when you turn regex mode on.

How to use

  1. Paste your text, then enter what to find and what to replace it with.
  2. Turn on regex mode for pattern matching and capture groups.
  3. Run to see the result.

When to use this tool

  • Renaming a repeated term across a large document.
  • Reformatting dates or codes with a regex capture-group replacement.
  • Stripping a recurring prefix, suffix, or boilerplate line.
  • Cleaning up inconsistent casing or punctuation in pasted text.

Tips

  • In regex mode, reference capture groups in the replacement as $1, $2, and so on.
  • Leave replacement blank to delete every match.
  • Case-sensitive matching is off by default — turn it on if "Foo" and "foo" should be treated differently.

FAQ

What regex flavour does this use?
Standard JavaScript regular expressions, run with the global flag so every match is replaced, not just the first.
Is my text sent anywhere?
No. Matching and replacing both run entirely in your browser.