Find and Replace
Search and replace text or JavaScript regular expressions across multi-line documents in your browser with live match counts and capture-group support.
Find and replace across any text with live match counting — literal mode escapes everything automatically so "$" and dots mean themselves, while regex mode unlocks groups ($1, $&) for power users. Invalid patterns surface a clear error instead of silently matching nothing.
How to use Find and Replace
- Paste the text, type what to find, and type the replacement.
- Toggle regex mode only if your pattern uses expression syntax — otherwise keep literal mode.
- Check the match count, then copy the result.
Who it is for
Developers batch-renaming identifiers, editors standardising names and dates across a document, data cleaners applying pattern fixes, and anyone who has been burned by a replacement that ate a dollar sign.
How it works
- Literal mode escapes the pattern AND the replacement, so replacing "cat" with "$100" inserts a literal $100 rather than an empty group.
- Regex mode passes your pattern straight to the RegExp engine with your chosen flags — case-insensitive, multiline, and capture-group replacements all work.
- The match counter updates on every keystroke, and an invalid expression shows the engine’s own error message.
What it cannot do
- It works on one document at a time — no multi-file search.
- Lookbehind and other advanced regex features depend on your browser’s engine, which is modern in every current browser.
Sample input & output
Text: Order #1042 shipped on 2026-11-25 Find (Regex): (\d{4})-(\d{2})-(\d{2}) | Replace: $3/$2/$1
Order #1042 shipped on 25/11/2026 — 1 match replaced using numbered regex capture groups.
Frequently asked questions
Why did my "$100" replacement insert an empty string?
That was regex mode: "$1" is a capture-group reference. In literal mode the tool escapes it for you — exactly the bug this tool exists to prevent.
Can I match across lines?
Yes — enable the multiline flag so ^ and $ match at every line start and end, and use \n or a dot-all flag in your pattern where needed.
How do I see how many replacements will happen before committing?
You already do: the match counter under the pattern counts live as you type, before you copy the result.
How do numbered capture groups ($1, $2) and $& work in Regex replacement mode?
When Regex mode is enabled, parentheses in your search pattern capture matched substrings that can be rearranged in the Replace field: $1, $2, … insert the corresponding group, $& inserts the entire matched substring, and $$ inserts a literal dollar sign. In plain Literal mode, dollar signs and backslashes are treated as ordinary text.
How can I replace line breaks, tabs, or convert comma-separated lists into rows?
In Regex mode, match \n for line feeds, \r?\n for cross-platform Windows/Unix line breaks, and \t for tab stops. For example, finding ,\s* and replacing with \n splits a comma-separated list onto clean individual lines, while finding \r?\n and replacing with ", " joins lines into one comma-delimited string.
What prevents catastrophic backtracking on complex regular expressions?
Nested quantifiers such as (a+)+ on non-matching long inputs can stall a browser's single-threaded JavaScript engine. Prefer specific character classes ([^,\n]+ instead of .*), anchor patterns with ^ or \b word boundaries where possible, and test complex expressions on a representative sample first.
Does Find and Replace modify my file on disk or upload sensitive text?
Neither. Pasted text is processed purely in browser RAM and written into the output pane so your original input remains intact for comparison or undo, and zero characters ever leave your device.