ToolsCrate

Find and Replace Text

Replace every occurrence of a word or pattern across a whole block of text — plain search, whole-word matching, or full regular expressions.

Regular expressions use JavaScript syntax. Capture groups can be referenced in the replacement as $1, $2 and so on — for example finding (\d+)-(\d+) and replacing with $2-$1 swaps the two numbers.

How to use

  1. 1Paste your text into the first box.
  2. 2Type what to find and what to replace it with.
  3. 3Turn on whole-word matching, or switch to regular expressions, if a plain search is too broad.
  4. 4Copy the result from the box below.

Frequently Asked Questions

How do I delete text instead of replacing it?

Leave the replace field empty. Every match is then removed from the text.

What can I do with regular expressions?

Match patterns rather than fixed text — dates, phone numbers, anything repetitive. Capture groups can be reused in the replacement as $1, $2, so finding (\d+)-(\d+) and replacing with $2-$1 swaps the two numbers everywhere.

What does whole words only do?

It stops partial matches. Searching for 'cat' with the option on will not match 'category' or 'concatenate'. It is disabled in regex mode, where you can use \b yourself.

Why did my regex fail?

Usually an unescaped special character or an unclosed bracket. The error message from the browser regex engine is shown in full, including the position where parsing failed.

Can I use captured groups in the replacement?

Yes. In regex mode, $1 and $2 in the replacement refer to the first and second bracketed groups in your pattern, which is how you reorder or reformat matched text.

Is the search case sensitive?

By default yes. Turn off case sensitivity to match regardless of case — note that the replacement is inserted exactly as you typed it, so it will not adopt the case of what it replaced.