Formula
result = text with each match of the search replaced by the replacement
- Plain text: the search is matched literally and the replacement is inserted exactly as typed
- Regular expression: $1, $2 and $& in the replacement refer to captured text
Every place the search text appears is swapped for your replacement, and the swaps are counted.
Worked examples
Whole-word replacement
- Your text
- The cat sat on the mat. Cat food is in the cupboard; concatenate carefully.
- Find
- cat
- Replace with
- dog
- Match as
- Plain text
- Upper and lower case
- Ignore case
- Whole words only (plain text)
- Yes
- Replace
- Every match
Replacements made
2
The dog sat on the mat. dog food is in the cupboard; concatenate carefully.
Reorder a date with a regular expression
- Your text
- Due 2026-10-18 and 2026-11-02.
- Find
- (\d+)-(\d+)-(\d+)
- Replace with
- $3/$2/$1
- Match as
- Regular expression
- Upper and lower case
- Case matters
- Whole words only (plain text)
- No
- Replace
- Every match
Replacements made
2
Due 18/10/2026 and 02/11/2026.
How it works
In plain-text mode the words you type are matched literally, so characters such as a full stop, a bracket or a dollar sign mean exactly what they say. Whole-word matching makes cat match the word cat but not concatenate or catalogue. The replacement is inserted exactly as typed, and the count shows how many places changed; if it shows zero, check spelling and the case setting.
In regular-expression mode the search is a JavaScript pattern and the replacement can use $1, $2 and so on for captured groups, $& for the whole match and $$ for a literal dollar sign. For example, searching (\d+)-(\d+)-(\d+) and replacing with $3/$2/$1 turns 2026-10-18 into 18/10/2026. An invalid pattern is reported with a plain explanation instead of failing silently.
Patterns are tested on your own text in your own browser. A badly written pattern with nested repeats can be slow on very long text, so keep patterns simple, and use the Regex Tester to experiment with a pattern before replacing. For repeated blank spaces use Remove Extra Spaces, for lists use Remove Duplicate Lines, and to see what changed use the Text Diff Checker.
Assumptions and limits
- Regular expressions use JavaScript syntax with Unicode support.
- In plain-text mode the replacement is literal; $ has no special meaning.
- Text above about 2 million characters is not accepted.