How find and replace works
Find and replace scans the whole text for a search string and swaps each match for the replacement. It is the same idea as Ctrl+H in Word or Ctrl+F in Google Docs, but it works on any text you paste, with a count and highlighted results, and without opening a document editor.
The three options
| Option | Effect | Example |
|---|---|---|
| Match case | Only matches with the same capital letters | "Apple" no longer matches "apple" |
| Whole word | Ignores matches inside longer words | "art" does not change "party" |
| Regular expression | Treats the search as a pattern | \d{4} matches any four-digit year |
By default the search is literal and not case sensitive. That means a search for "(draft)" finds exactly those characters, which is what most people expect.
Regular expression examples
With regex on, the pattern follows JavaScript syntax and the Unicode flag is active. A few that people use often:
- Double spaces to one: find
\s{2,}, replace with a single space. - Swap name order: find
(\w+), (\w+), replace with$2 $1to turn "Smith, Jane" into "Jane Smith". - Reformat dates: find
(\d{4})-(\d{2})-(\d{2}), replace with$2/$3/$1to turn 2026-11-01 into 11/01/2026. - Delete empty lines: find
^\s*\nis not supported across lines here, so use the Text Cleaner for blank lines.
If the pattern is invalid, the tool shows an error instead of changing your text.
Tips for safe replacing
- Search for a longer phrase first, then shorter ones, so a short replacement does not break a longer match.
- Use whole word for short terms.
- Read the count: 400 replacements when you expected 4 means the search is too broad.
- Copy the result into a new document and keep the original until you are happy.
Limits
The tool changes the pasted text only; it does not edit your files, and there is no undo once you replace in the output, so rerun from the original text. It replaces matches in one pass and does not search other documents. For comparing the original with the result, use Text Compare.