Skip to content

Find and Replace Text

Find a word or pattern in your text and replace every match, with options for case, whole words and regular expressions.

Find and replace
Type what to find and what to put instead.

Result
Result
The dog sat on the dog mat. Condogenate the dog.
4
Matches replaced

Private: Everything runs in this page. Nothing you type is sent anywhere or saved.

On this page
  1. Find and replace examples
  2. Formula
  3. How the find and replace works
  4. What this tool does not do
  5. Frequently asked questions
  6. Related tools

Find and replace examples

TextFind / replaceOptionsResult
a.b.c. / -defaulta-b-c
Cat cat CATcat / dogdefaultdog dog dog
Cat cat CATcat / dogcsCat dog CAT
cat concat catcat / dogworddog concat dog
10-20(\d+)-(\d+) / $2-$1regex20-10

Formula

every match of the find text is replaced by the replacement

How the find and replace works

  1. Step onePaste your text in the first box.
  2. Step twoType the text to find and the text to put instead. Leave the second empty to delete every match.
  3. Step threeTick the options you need, then copy the result.

What this tool does not do

  • Without the regular expression option, special characters such as a dot or a star are treated as plain text.
  • A badly written regular expression can take very long to run. The page runs it in the background and stops it after 1.5 seconds with a message, so the page stays usable.
  • Where the browser cannot start a background worker (or the page is opened as a local file), the pattern runs in the page itself, only the first 1,000 characters are checked, and a very slow pattern can still make the page wait.
  • It works on the text in the box only and never on files.

Frequently asked questions

Can I use wildcards?

Tick the regular expression option and write a pattern. For example \d+ matches a run of digits, and (\w+)@ captures the word before an at sign.

How do I use the matched text in the replacement?

With the regular expression option on, $1 stands for the first group in brackets, $2 for the second, and $& for the whole match.

What if my pattern is invalid?

The tool shows the reason and leaves your text unchanged.