Find and replace
Transformed in your browser · nothing is uploaded
Replaces every match as you type. Plain text by default, with a checkbox for regular expressions and capture groups usable as $1 and $2, and another for case-sensitive matching. The bulk option takes a list of find | replace pairs, one per line, and applies all of them in a single pass, in order.
How to use the find and replace
Plain-text mode escapes your search string, which is the behaviour people expect and most tools get wrong: searching for a full stop should find full stops, not match every character as a regex wildcard would. Ticking Regular expression gives you the full pattern language, with capture groups available in the replacement as $1, $2 and so on, and \n to match a line break so a replacement can cross lines. Matching ignores case in both modes until you tick Case sensitive, which is the setting to reach for when you are renaming a variable, an identifier or anything else where Order and order are two different things. One deliberate behaviour worth knowing: an invalid regular expression leaves the text unchanged rather than showing an error, because you are typing the pattern one character at a time and every incomplete pattern would otherwise be an error state.
The bulk option exists because a glossary of substitutions — renaming twenty terms, anonymising a set of names, applying a house style — is not twenty visits to a find box. It reads one pair per line, split on the first pipe, and skips any line without one. The case-sensitive setting applies to every pair in the list; regular expressions do not, and belong to the single replacement, where you can see what the pattern is doing.
The trap in any bulk replacement is that the pairs run in order, so an earlier replacement can be found again by a later one. Replacing a with b and then b with c turns every original a into c, which is almost never what was intended and is the source of most surprises here. There are two ways round it: order the pairs so no replacement value appears in a later find, or replace into placeholders in a first pass and resolve the placeholders in a second. Neither is clever, and one of them is always available.
What people use it for
- Applying a whole glossary of term substitutions to a document in one pass
- Anonymising a support ticket by swapping every real name for a placeholder
- Renaming a product across a page of copy without opening an editor
- Deleting a repeated prefix from a pasted list by replacing it with nothing
- Reformatting dates or reference codes with a pattern and its capture groups
- Applying a house-style rule across a draft before it is filed
Questions
Only if you tick Case sensitive. Matching ignores case by default, and the setting applies to the bulk pairs as well as the single replacement.
Tick Regular expression. Capture groups are available in the replacement as $1, $2 and so on.
In plain mode yes: searching for "." finds full stops. In regex mode they have their usual meaning.
An invalid regex leaves the text unchanged rather than erroring, since you are typing it a character at a time.
Yes. In regex mode, use \n to match a line break.
One per line, as find | replace. The line is split on the first pipe, and a line without one is skipped.
Yes, and an earlier replacement can be caught by a later find. Replacing a→b then b→c turns every a into c.
Order the pairs so no replacement value appears in a later find, or replace into placeholders and resolve them in a second pass.
No, bulk pairs are plain text. Use the single find and replace for a pattern. Case sensitivity does carry across to them.
No. The replacement runs in this tab, whichever mode you use.
Every one. The search is global in both modes, so there is no step-through-the-matches step.
Leave "Replace with" empty and every match is removed. In bulk mode, a pair ending in a bare pipe does the same.
No, both halves are trimmed, so "cat | fox" and "cat|fox" behave identically. The consequence is that bulk mode cannot replace a term with a leading or trailing space, and a pair with nothing before the pipe is skipped.