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
Find and replace examples
| Text | Find / replace | Options | Result |
|---|---|---|---|
| a.b.c | . / - | default | a-b-c |
| Cat cat CAT | cat / dog | default | dog dog dog |
| Cat cat CAT | cat / dog | cs | Cat dog CAT |
| cat concat cat | cat / dog | word | dog concat dog |
| 10-20 | (\d+)-(\d+) / $2-$1 | regex | 20-10 |
Formula
every match of the find text is replaced by the replacement
How the find and replace works
- Step onePaste your text in the first box.
- Step twoType the text to find and the text to put instead. Leave the second empty to delete every match.
- 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.