Replace every occurrence of a word or pattern in a text at once. Search as plain text or as a JavaScript regular expression with flags, use $1 or $<name> in the replacement, see each match with its line and column, and undo single replacements before you copy the result. The replaced text can also be read aloud.
- Can I replace every occurrence at once?
- Yes. Every match in the text is replaced in one pass, and the number of replacements is shown next to the result.
- Is the search case-sensitive?
- Yes, by default. To ignore case, tick Regular Expression and then Case insensitive (i).
- Can I skip some matches?
- Yes. Each match in the Replace Details has an Undo button that puts the original text back at that spot; press it again to replace it again. Undo All restores every match and Replace All replaces them all again.
- Which references can I use in the replacement?
- $& inserts the whole match, $1, $2 and so on (or ${1}) insert numbered groups, and $<name> inserts a named group. $` and $' are not supported. A reference to a group that does not exist is left as it is.
- Can you give an example with a regular expression?
- To turn “Smith, John” into “John Smith”, search for (\w+),\s*(\w+) and replace with $2 $1. To remove spaces at the end of each line, search for [ \t]+$ with Multiline (m) and leave the replacement empty.
- Can I insert line breaks?
- No. The replacement is a single-line field and is inserted literally, so typing \n does not create a line break. You can still find line breaks with \n in a regular expression and replace them with something else.
- Is my document uploaded?
- No. Find and replace runs in your browser. The source text, search string and replacement are also kept in the page URL when they are short enough, so reloading keeps your work.
- What is it useful for?
- Renaming a term throughout a document, cleaning up text pasted from PDFs or spreadsheets, changing date formats with a regular expression, or adjusting a list before pasting it into code.