About the Find and Replace Text
Find and replace every occurrence of a word, phrase or pattern across a whole block of text at once. Matching is case-insensitive by default and can be made exact, and a regex option unlocks full regular expressions including capture groups referenced as $1 and $2 in the replacement. Special characters in plain-text mode are escaped automatically, so searching for a full stop finds a full stop rather than matching everything. The number of matches is reported before you commit, and invalid patterns are flagged instead of failing silently. Nothing is uploaded.
How to use the Find and Replace Text
- 1
Paste the text you want to edit into the 'Your text' box.
- 2
Enter the word or pattern in 'Find' and its replacement in 'Replace with' — leave the replacement empty to delete matches.
- 3
Tick 'Match letter case' for an exact, case-sensitive search.
- 4
Tick "Treat 'Find' as a regular expression" for pattern matching, capture groups and character classes.
- 5
Check the 'Matches found' figure, then copy the result or download it as replaced.txt.
What people use it for
Rebranding a document
Changing a product or company name across a long page is a single operation here, and the match count confirms you caught every instance rather than the handful you happened to scroll past.
Reformatting exported data
A regex such as (\d{4})-(\d{2})-(\d{2}) with a replacement of $3/$2/$1 converts a column of ISO dates into day-first format without opening a spreadsheet.
Stripping unwanted markup or noise
Leaving the replacement empty and searching with a pattern removes every match outright, which is the fastest way to clear stray tags, tracking parameters or timestamps from pasted content.
Anonymising text before sharing
Replacing real names and email addresses with placeholders makes a log or a transcript safe to paste into a ticket, and because the tool runs locally the original never leaves your machine.
Plain-text mode escapes your input for you
In plain-text mode the search term is converted into a regular expression internally, but every character with special meaning is escaped first: full stop, asterisk, plus, question mark, caret, dollar, braces, parentheses, pipe, square brackets and backslash. This matters more than it sounds. Without escaping, searching for the literal string 'e.g.' would treat each full stop as 'any character' and match 'eggs' as readily as the abbreviation, and searching for '(1)' would be read as a capture group containing the digit 1 rather than a bracketed number. Because the escaping is automatic, plain-text mode always does what you would expect from a word processor: what you type is what is matched, punctuation and all. The replacement string is a different matter. Even in plain-text mode the replacement is processed by the underlying replace routine, which gives the dollar sign a special meaning — $& inserts the whole match and $1 inserts a capture group. If you need a literal dollar sign in your replacement, write it as $$. This is the one asymmetry in the tool and the cause of most unexpected results when replacing prices or currency amounts.
Regex mode, flags and common patterns
With regex mode on, the Find field is compiled directly as a JavaScript regular expression. The global flag is always applied so every occurrence is replaced, and the case-insensitive flag is added unless 'Match letter case' is ticked. No multiline or dotAll flag is set, which has two consequences worth remembering: the caret and dollar anchors match only the very start and very end of the whole input rather than each line, and a full stop does not match a newline, so patterns intended to span lines need an explicit character class such as [\s\S] instead. Useful starting points include \s+ to collapse runs of whitespace, \b to anchor to word boundaries so that replacing 'cat' does not damage 'category', and (\w+)@(\w+) with a replacement of $2 to swap the halves of a pair. Capture groups are numbered from left to right by their opening bracket and referenced as $1 upward. An invalid pattern — an unclosed bracket is the usual culprit — is caught and reported rather than being applied, and the match count updates as you type, which makes it easy to refine a pattern until the number looks right before you copy the output.
Tips
- Check the 'Matches found' count before copying — a number far higher than expected usually means the pattern is matching inside longer words.
- Wrap a plain word in \b anchors in regex mode to replace whole words only.
- Escape a literal dollar sign in the replacement field as $$, since a single $ is treated as a group reference.