Text Replacer

Find and replace text, with regex and batch rules

Replace every occurrence of a word or phrase - or apply a whole list of find → replace rules at once. Supports case-sensitive, whole-word and regular expression matching with $1 group references.
Try an example:

Output will appear here...

About Text Replacer

How it works

  1. Every match of your search is replaced; the stats show how many replacements were made and how many lines changed.
  2. Batch mode applies several "find => replace" rules in order - e.g. to convert British to American spelling.
  3. With regular expressions, ^ and $ match at the start and end of every line, and $1, $2... insert captured groups.
  4. Whole-word mode avoids replacing "cat" inside "category".

What you need

  • Your text, plus what to find and what to replace it with (leave "Replace with" empty to delete matches).

Tips

  • Regex example: find (\w+)@(\w+)\.com and replace with $2: $1 to rearrange email addresses.
  • Rules run top to bottom, so put longer phrases before shorter ones that they contain.
  • Use "Use as input" to chain several replacements.

Limitations

  • Regex uses JavaScript syntax (lookbehind is supported; possessive quantifiers are not).
  • Very complex patterns on huge text can be slow.

Runs in your browser. Your text never leaves your browser.

Frequently asked questions

How do I delete every occurrence of a word?+

Put the word in "Find" and leave "Replace with" empty.

What does $1 mean?+

In regex mode, $1 is the text matched by the first pair of brackets in your pattern, $2 the second, and $& the whole match.

Can I replace line breaks?+

Yes, with regex: find \n and replace with what you want (for example a comma). The Line Break Remover makes common cases easier.

In what order do batch rules run?+

Top to bottom, each on the result of the previous one. The table shows how many replacements each rule made.