Two things make a bulk replace go wrong, and both are silent
Replacing text is trivial. Replacing it across a long document, correctly, and knowing that you did, is not, and the two ways it fails do not announce themselves.
Your search is probably being treated as a regular expression
A lot of tools take whatever you type and push it straight into a regex. That means:
- A full stop matches any character, so searching for "a.c" also hits "abc".
- Brackets group things, so searching for "(" is an error rather than a search.
- A dollar means end of line, so searching for "$5.00" finds almost nothing.
Here, plain mode escapes every one of those, so what you type is what gets matched. Regular expressions are a switch you turn on when you want them.
And the dollar sign in the replacement is worse
In a replacement string, $1 means the first captured group and $& means the whole match. So replacing a price with $5 can be read as "group 5" and quietly vanish, and replacing something with $& reinserts what you were trying to remove.
In plain mode the replacement is escaped as well, so a dollar is a dollar. In regex mode it is left alone, because there the group references are the entire point.
The preview is the actual feature
A count tells you something happened. It does not tell you whether the right thing happened, and a replace that hits 400 places when you expected 12 looks identical to one that worked until you read the document.
So every line that changes is listed, before and after, and you can check a few before taking the result. This is the thing a text editor's replace-all does not give you and the reason it is worth pasting into a tool at all.
When nothing matches
Three causes, in the order they are likely:
- Case. Match case is on and the text differs.
- Whole words. "cat" will not match inside "cats" while that is ticked.
- Curly quotes. Text pasted from Word carries typographic apostrophes and quotation marks, which are different characters from the ones on your keyboard and look nearly identical.
The third catches almost everybody at some point, and the fix is to copy the character out of the document itself rather than typing it.
The one regex worth learning
Swapping two things around. Search for (\w+) (\w+) and replace with $2, $1. The brackets capture each word and the numbers put them back in the other order, so "john smith" becomes "smith, john" across a whole list at once.
Everything runs on your own machine. Nothing is uploaded, nothing is stored, and there is no account, so a document with real names and addresses in it is safe to paste.
Common questions
Why does searching for a full stop match everything?
Because a lot of tools push whatever you type straight into a regular expression, where a full stop means "any character". Searching for "a.c" then also matches "abc", and nothing tells you. This tool escapes every special character in plain mode, so what you type is matched literally, and the regular expression behaviour is a switch you turn on deliberately.
Why did my replacement swallow the number after the dollar sign?
Because in a replacement string, "$1" means the first captured group and "$&" means the whole match. So replacing something with "$5" can be read as group 5 and disappear. In plain mode this tool escapes the replacement too, so a dollar is a dollar. In regex mode it is left alone, because there the groups are exactly what you want.
Why does nothing match when I can see the text?
Three usual causes. Case sensitivity is on and the text differs in case. Whole words is on, so "cat" will not match inside "cats". Or the text contains a curly apostrophe or quote where you typed a straight one, which happens constantly with anything pasted from Word and is completely invisible on screen.
Can I see what will change before I commit to it?
Yes, and that is the main reason to use this rather than a text editor. Every line that changes is listed with the before and after side by side. A bulk replace is easy to get subtly wrong and very hard to spot afterwards, especially in a long document, so checking two or three lines before you copy the result is worth the ten seconds.
How do I swap two things around, like first and last names?
Turn on regular expressions, search for (\w+) (\w+) and replace with $2, $1. The brackets capture each word as a group and the dollar numbers put them back in the other order. It is the most useful thing regex mode does.
How do I delete something rather than replace it?
Leave the replace box empty. Every match is removed. If you are deleting a word and want to avoid a double space where it used to be, include the trailing space in your search.
Is my text uploaded?
No. Everything runs in your browser, on your own machine, with no server involved and nothing stored. You can safely paste a document with names, addresses or contract terms in it.
What does "apply and carry on" do?
It takes the result and puts it back in the input box so you can run a second replace on it, then a third. Useful when you are cleaning up a document that needs several passes, and it saves copying the output back to the top each time.