Find and Replace
Search and replace text, with regex support
About the Find and Replace
Swapping one word for another across a wall of text — renaming a variable in a snippet, updating a product name in a draft, or fixing a typo that appears a dozen times — is exactly the job for find and replace. This tool does it in the browser with a live preview and a running count of how many replacements it made.
Type what to find and what to replace it with, and the result updates as you go. A "Match case" checkbox controls whether the search is case-sensitive, and a "Use regular expressions" checkbox unlocks pattern matching for the trickier jobs: collapsing whitespace, reformatting dates, or capturing part of a match and reusing it. Editors cleaning up imported copy, developers tweaking code blocks, and anyone reformatting data lean on it instead of editing by hand.
When regex mode is on, an invalid pattern shows a clear error rather than failing silently, and capture-group references like $1 work as they do in JavaScript, so you can rearrange text, not just substitute it.
How to Use the Find and Replace
- Paste your text into the main box.
- Enter the term or pattern to find, and what to replace it with.
- Tick "Match case" for an exact-case search, or "Use regular expressions" for pattern matching.
- Watch the replacement counter, then copy the result from the output box.
Why Use ToolForge’s Find and Replace
- Replacements happen live in your browser as you type, with a count so you know immediately how many matches were affected.
- Full regular-expression support — including capture-group backreferences — handles reformatting jobs a plain text swap cannot.
- In literal mode the search term is escaped for you, so special characters like dots and parentheses are matched as themselves, not as regex syntax.
- An invalid regular expression surfaces a readable error instead of breaking, so you can fix the pattern and carry on.
Frequently Asked Questions
How do I use regular expressions here?
Tick "Use regular expressions" and type a pattern in the Find box — for example \d{4} to match any four digits. The pattern runs globally, and turning off "Match case" adds the case-insensitive flag. You can reference captured groups in the Replace box with $1, $2, and so on.
Why is my search not finding a match?
Check the "Match case" setting — with it on, the search is case-sensitive, so "Cat" will not match "cat". In literal (non-regex) mode the text must appear exactly; switch to regex mode if you need flexible matching like optional characters or word boundaries.
Does it replace every occurrence or just the first?
Every occurrence. The replacement is applied globally across the whole text, and the counter tells you how many matches were changed.
Is my text kept private?
Yes — the find-and-replace runs locally in your browser using JavaScript's own string and RegExp engine, so nothing is uploaded.
