Find and replace looks like the simplest possible text operation — until the text you're searching contains partial matches, mixed casing, or a pattern that changes shape each time, all of which plain literal search handles badly.
When Plain Text Search Isn't Enough
A plain literal search matches your exact search text wherever it appears, with no understanding of word boundaries or patterns. That's fine when you're replacing one fixed string with another fixed string. It falls apart the moment you need to match something that varies — every phone number in a document, every price with a dollar sign, every instance of a word but not its substring inside other words. Those cases need either a smarter matching option or a genuine pattern language.
Whole Word Matching
Whole word matching solves the "substring inside another word" problem specifically. Searching for "cat" without it will match the "cat" hidden inside "category," "concatenate," and "cats" — which is rarely what you actually want. Turning on whole word matching restricts the match to complete words only, using word-boundary logic to check that what's immediately before and after the match isn't itself part of a word, so "cat" the standalone word gets replaced while "category" is left untouched.
Regex Capture Groups
Regular expressions (regex) turn "find" from a literal string into a pattern — \d+ matches one or more digits, wherever they appear and however many there are, without you needing to know the exact numbers in advance. Parentheses in a regex pattern create "capture groups," which remember the exact text that matched that part of the pattern. In the replacement text, referencing $1 (or $2, for a second group, and so on) reinserts whatever that group actually captured — letting you rearrange or reformat matched text rather than just deleting it and typing something fixed in its place. An invalid pattern should produce a clear error rather than a silent wrong result, since a malformed regex can otherwise fail in confusing ways.
Case Sensitivity Pitfalls
By default, most find-and-replace tools match regardless of capitalization — "Dog," "dog," and "DOG" are all treated as the same search term unless case-sensitive matching is explicitly turned on. This default is usually what people want, but it's also a common source of unintended replacements: a case-insensitive search for "may" will also catch "May" the name or month, which a case-sensitive search would correctly leave alone.
Replacing Text Instantly
Paste your text, enter what to find and replace, and toggle case-sensitive, whole-word, or regex matching with a live match count using our free Find and Replace Text Tool. Need to reorder or de-duplicate lines instead of replacing text within them? Try the Line Sorter & Randomizer.
FAQ
What does "Whole word only" do? It only matches your search text when it appears as a complete word, not as part of a longer word — so searching for "cat" with this on won't match inside "category," but will still match the standalone word "cat."
How does the regular expression option work? When enabled, the "Find" field is treated as a JavaScript regular expression pattern instead of literal text, letting you use patterns like \d+ to match numbers or use capture groups like ($1) in the replacement field to reuse matched text. If your pattern is invalid, the tool shows an error instead of guessing.
Does find and replace change only the first match or every match? Every match, by default — turn off "Replace all occurrences" if you only want the first match in the text replaced.
Is my text sent anywhere when I use a find and replace tool? No — the find-and-replace operation runs entirely in your browser using JavaScript, so your text is never sent to a server.