Find and Replace
Bulk find and replace across pasted text with regex support, case sensitivity toggle and match highlighting preview
How Find and Replace Works
Paste your text, type the term you want to find, type what you want to replace it with, and a live preview shows the result. The match counter at the top right tells you how many times your search term appears before you commit to anything. Click Apply to overwrite the original text with the replaced version, or just hit Copy to grab the preview output.
Three toggles change the matching behaviour. Case sensitive forces an exact match, so 'Apple' and 'apple' are treated as different. Whole word stops partial matches, so searching for 'art' will not turn 'cartoon' into 'cb'. Regex mode lets you write patterns like \d+ to match every number or \s+$ to match trailing whitespace. The first two toggles are disabled when regex mode is on, because regex flags handle that work itself.
Regex Mode for Power Users
When regex mode is active, twelve special characters do special things: . * + ? ^ $ { } ( ) | [ ] \\. A common trip-up: searching for the literal string '$10.00' in regex mode without escaping the dot or the dollar sign will match '$10X00' and similar variants. If you want a literal dollar sign or full stop, prefix it with a backslash. Outside regex mode, the tool escapes all of these for you, so 'find $10.00' works as you would expect.
Useful patterns for everyday writing: \bteh\b catches a frequent typo without breaking 'them'. ([A-Z][a-z]+)\s+([A-Z][a-z]+) with a replacement of $2 $1 swaps first and last names in a roster. Two newlines collapsed to one is \n{2,} replaced with \n. The replacement field supports $1, $2 and so on for capture groups, the same syntax JavaScript's String.replace uses.
Common Find and Replace Patterns
| Goal | Find (regex mode) | Replace with |
|---|---|---|
| Strip trailing spaces from every line | [ \t]+$ | (empty) |
| Collapse double spaces | {2,} | |
| Wrap every numeric value in <strong> | (\d+(?:\.\d+)?) | <strong>$1</strong> |
| Convert UK dates to ISO | (\d{2})/(\d{2})/(\d{4}) | $3-$2-$1 |
| Remove blank lines | ^\s*\n | (empty) |
Frequently Asked Questions
Why does my regex not match anything?
The most common cause is unescaped special characters. Symbols like ., *, +, ?, ^, $, (, ), [, ], {, }, | and \\ all carry meaning in regex. If you want them treated as literal characters, prefix each one with a backslash. The match counter staying at zero is your hint that the pattern is malformed. Switch off regex mode for plain literal searches.
Will it process huge documents?
All matching runs in your browser using JavaScript's RegExp engine, which handles documents up to a few megabytes comfortably. A 50,000 word manuscript replaces in well under a second. Once you get into millions of lines you may notice a delay, especially with greedy regex patterns. Nothing leaves your machine, so even confidential client work stays private.
Can I undo a replacement?
Until you click Apply, the original text is untouched. The right-hand panel just shows a preview. After applying, use your browser's standard undo (Ctrl+Z or Cmd+Z) inside the textarea, or paste the original back from your clipboard. For long editing sessions, consider working in chunks rather than running one mega-replacement.
Does it support multi-line patterns?
Yes, but you need to use the right metacharacter. \n matches a newline, \s matches any whitespace including newlines. The dot . does not match newlines by default in JavaScript regex. If you need that behaviour, use [\s\S] as a workaround, which matches absolutely any character including line breaks.