Find and replace is the fastest way to apply a consistent change across a body of text — renaming a term throughout a document, fixing a repeated typo, or reformatting an exported list. With regular expressions enabled it also handles patterns rather than fixed strings.
How to use the Find & Replace
- Paste your text into the input box
- Enter what to find and what to replace it with
- Enable case-sensitive or regex mode if you need them
- Replace, then copy the result
Case sensitivity, and the trap in it
A case-sensitive replace of color with colour leaves Color at the start of sentences untouched. A case-insensitive one catches it, but replaces it with lowercase colour, breaking the sentence.
For terms that appear both mid-sentence and capitalised, run two case-sensitive passes — one for each form — rather than a single case-insensitive one.
Using regular expressions
Regex mode matches patterns instead of literal text. A few that come up constantly:
\s+$— trailing whitespace at the end of lines.\n{3,}— runs of three or more blank lines, for collapsing to two.\d{4}-\d{2}-\d{2}— ISO dates.\((\d{3})\)\s*(\d{3})-(\d{4})— US phone numbers, with capture groups you can reorder as$1$2$3.
Capture groups in the search pattern are referenced in the replacement as $1, $2 and so on, which is how you reformat rather than merely substitute.
Replacing safely across a large document
The danger in find and replace is not the replacements you intended; it is the ones you did not notice.
Partial-word matches are the classic. Replacing cat with dog also converts category into dogegory and concatenate into condogenate. Replacing id with identifier damages almost every word containing those two letters. The fix is a regular expression with word boundaries — \bcat\b — or including the surrounding spaces in the search when the term always stands alone.
Order matters when replacements chain. Replacing A with B and then B with C turns the original As into Cs, which is rarely intended. Where two replacements interact, use a temporary placeholder that appears nowhere in the text for the first pass.
Count before you commit. If you expect twelve occurrences and the tool reports 340, something is matching that you did not anticipate — and that is far easier to discover before the replacement than after.
Keep the original in the input box until you have checked the output. There is no undo once you have copied the result over your source.
Replacements that regular expressions make possible
Plain replacement swaps fixed strings. A regular expression can match a shape and reuse parts of what it matched, which covers a large class of edits that would otherwise be manual.
Reordering with capture groups. Searching (\w+),\s*(\w+) and replacing with $2 $1 converts a whole column of Surname, Firstname into Firstname Surname in one pass.
Reformatting dates. (\d{2})/(\d{2})/(\d{4}) replaced with $3-$2-$1 turns European dates into ISO ones.
Collapsing whitespace. Searching \s+ and replacing with a single space normalises text pasted from a PDF, where line breaks land mid-sentence.
Stripping what you do not want. ^\s+|\s+$ removes leading and trailing whitespace from every line, which is the fix for lists that will not deduplicate.
Wrapping each line. Searching ^(.+)$ and replacing with <li>$1</li> converts a plain list into HTML.
Test any pattern on a small sample first. A regex that matches more than you expected is much harder to notice than one that matches nothing.
Frequently asked questions
Can I undo a replacement?
Not within the tool — always keep the original text until you have checked the output. Replacing an empty search string, or an over-broad regex, can change far more than intended.
How do I delete text rather than replace it?
Leave the replacement field empty. Every match is removed.
Why is my regex not matching?
The most common causes are unescaped special characters — . * + ? ( ) [ ] { } | ^ $ \ all have meaning in regex and need a backslash to match literally. Test the pattern in the Regex Tester first.
Can I replace across line breaks?
Yes, in regex mode — use \n to match a newline. In plain text mode the search string is matched literally, including any line breaks you paste into it.