Whole words, and why it matters
Replacing cat without whole-word matching also rewrites concatenate, catalogue and location. It is the classic way a bulk edit quietly ruins a document, and the damage is scattered rather than obvious.
Whole-word matching requires a word boundary on both sides, so only the standalone word is replaced.
When to reach for a regular expression
Plain replacement handles fixed strings. A pattern handles a shape: every phone number, every date, every line beginning with a timestamp. Captured groups can be referred to in the replacement as $1, which is how you reorder rather than merely substitute — turning Surname, Forename into Forename Surname across a whole list in one pass.
The regex tester is the place to get the pattern right first; testing it here means testing it on the document you are about to change.
Frequently asked questions
Why did it change words I did not mean?
Your search term appeared inside longer words. Turn on whole-word matching, which requires a boundary on both sides.
Can I reorder text rather than just replace it?
Yes, with a regular expression and capture groups — refer to them as $1 and $2 in the replacement to swap parts around.
Is there an undo?
Keep the original in another tab or file before a large replacement. This shows you the result rather than editing in place, so nothing is lost until you replace your source.
Something wrong with this tool, or an idea for it? Tell us