Live regex matching with groups, flags and a replace preview
Find and Replace
Make the same change everywhere in a long text at once and see every change before you copy it.
Loading tool…
How to use find and replace
Paste your text or open a file.
Type what to find and what to replace it with.
Choose plain text or regular expression, and match case or whole words.
Check the match count and the preview, then copy, download or use the result as new input.
What this tool does
- Plain mode finds the text exactly as typed; special characters need no escaping.
- Regex mode supports groups in the replacement: $1 to $99, $<name>, $& and $$.
- Whole words works in every alphabet, not just English letters.
- Shows a count of matches and a preview of the first 100 changes in context.
- Runs each search in a background worker with a 2 second limit, so a runaway pattern cannot freeze the page.
How the result is verified
In plain mode, the result's length must equal the original plus the number of matches times the difference in length between the replacement and the search; the tool checks this after every run.
Frequently asked questions
How do I use $1 in the replacement?
Switch to Regular expression and put brackets around the parts you want to reuse. Finding (\d{4})-(\d{2})-(\d{2}) and replacing with $3/$2/$1 turns 2026-03-14 into 14/03/2026.
Why did my pattern stop with a time limit message?
Some patterns, such as (a+)+ on a long run of a's, take exponential time. The search runs in a separate worker and is stopped after 2 seconds; rewrite the pattern without nested repeats.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Pull every match or capture group into a list, deduplicated and sorted
Hidden characters, spaces, blank lines and quotes cleaned in one pass
Compare two texts line by line with changed words highlighted
Curly quotes to straight, or straight to curly with sensible rules