Find & Replace
Support plain text and regex, optional case-insensitive, replace everywhere
Find and replace: the difference between plain text and regex mode
The essential difference between the two modes
| Plain mode | Regex mode | |
|---|---|---|
| Find field | Literal substring | Pattern (metacharacters carry special meaning) |
| Special characters | All ordinary, no escaping needed | . * + ? ( ) [ ] { } | ^ $ \ must be escaped |
| Replace field | Written verbatim | $1, $& and similar reference capture groups |
| Typical use | Rename a token, swap a separator, delete a word | Reformat, normalize by pattern, extract and reorder |
For "replace a word", plain mode is the safest choice — you do not think about any escaping at all. Switch to regex mode and a . suddenly means "any character", a ( becomes the start of a group, and an unpaired bracket throws an error on the spot.
Replacement references in regex mode
This is where regex replacement earns its keep — it does not merely substitute, it restructures:
| Replacement syntax | Meaning |
|---|---|
$1 $2 | Contents of the first, second capture group |
$& | The entire matched text |
$ followed by a backtick | Text before the match (that character cannot be written directly here; see MDN on String.replace) |
$' | Text after the match |
$$ | A literal dollar sign |
Practical example — turn 2026-01-15 into 15/01/2026: find (\d{4})-(\d{2})-(\d{2}), replace with $3/$2/$1. Plain mode cannot do this, because it is a "reorder", not a "replace".
Another one: indent the start of every line. Find ^(\S), replace with $1 (with the multiline flag on).
Three places that bite
- In plain mode
$is a literal, but in a regex replacement it is a reference prefix. To emit a literal dollar sign, write$in plain mode; in regex mode write$$. - Ambiguity in backreference numbers.
$12is read as the twelfth capture group (if it exists), not "group 1 followed by the character 2". When you need the latter, write$1then2separately, without a space, or use a named group. - The ignore-case flag affects find only, never replace. The replacement text is written exactly as you give it; its casing is your decision. To turn both
colorandColorintocolour, tick ignore-case; but to preserve each original casing you need two replacement passes or a$&-based trick.
Check before you act
Batch replace is irreversible unless you kept the original. Suggested flow:
- First confirm the pattern matches what you intend with the regex tester — look at match count and each matched span.
- Watch for accidental matches. Replacing
idwill hituserId,valid,hidden— use a word boundary\bid\bto avoid that. - Read through the result after replacing; do not just trust "replacement done".
- Keep a copy of the source. The output is read-only, and the original still sits in the input box, but if you keep editing inside the input box you overwrite it.
Replacement runs locally in your browser; text containing sensitive information is never uploaded.
FAQ
Can the replacement box use $1 in regex mode?
Yes. The replacement supports backreferences like $1 $2 referencing capture groups in the regex.
How do ignore-case and regex work together?
When both "Regex" and "Ignore case" are checked, the i flag is added automatically so matching is case-insensitive.