Find and replace
What is a Find And Replace?
Find and replace is one of the most useful text operations, but many simple editors lack advanced options. This tool supports plain text, case-insensitive and whole-word matching, and full regular expressions with capture groups, so you can do bulk edits on lists, logs, CSV exports or code snippets in seconds.
How to use it
- Paste your text.
- Enter what to find and what to replace it with.
- Choose options: match case, whole word or regular expression.
- Review the result and copy it.
Examples
- Whole word: replacing
catwithdogas a whole word changes cat but leaves category alone. - Regex reformat dates: find
(\d{2})/(\d{2})/(\d{4})and replace with$3-$2-$1to turn 27/10/2026 into 2026-10-27. - Collapse spaces: find
\s{2,}and replace with a single space. - Swap names: find
(\w+), (\w+)and replace with$2 $1to turn Smith, Anna into Anna Smith.
Regex tips
- Special characters such as
. * + ? ( ) [ ] { } | ^ $must be escaped with a backslash to match them literally. $1,$2refer to capture groups in the replacement;$&inserts the whole match.- Patterns are JavaScript regular expressions, so syntax matches what you would use in JS code.
- Test on a small sample first; a greedy
.*often matches more than intended.
Frequently Asked Questions
How do I use capture groups in the replacement?
Wrap parts of the pattern in parentheses and refer to them as $1, $2 and so on in the replacement text.
What does whole word mean?
The match must not be part of a longer word. Searching for cat will not match category.
Why does my regex replace too much?
Quantifiers like .* are greedy. Use a lazy version such as .*? or a more specific character class.
Which regex flavour is used?
JavaScript regular expressions, as used in browsers and Node.js.