Find and Replace
Regex, capture groups, and rule chains that run in order — with a guard against patterns that freeze the page.
Start typing above and the result appears here.
How to use Find and Replace
Paste your text
Nothing is uploaded — the replacement runs in this browser tab.
Enter what to find
Turn on regex for patterns, and use $1 and $2 in the replacement to reuse capture groups.
Or write a list of rules
Switch to rule mode and write one "find => replace" per line. They run in order, each seeing the previous result — which is how real cleanup actually works.
Why use this find and replace
Runs on your device
Your input is handled entirely in this browser tab. Nothing is uploaded, so there is nothing for us to store, log or leak.
No sign-up, no quota
No account, no daily limit, no watermark and no email wall. Use it once or two hundred times a day.
Built to be linked
Options are stored in the URL, so a configured tool is a link you can send to a colleague or bookmark.
Technical notes
Two things separate this from the dozen other regex replacers online. Rules run as an ordered chain, each seeing the previous output, because real cleanup is never one substitution. And the pattern is checked for catastrophic backtracking before it runs — JavaScript regex has no timeout, so an unguarded (a+)+ locks the tab with no way out.
Patterns this tool refuses, and why
| Pattern | Problem | Safe rewrite |
|---|---|---|
| (a+)+$ | Quantifier on an already-repeating group | a+$ |
| (\w+\s?)*$ | Same shape, harder to spot | [\w\s]*$ |
| (x|x)*y | Alternation with identical branches under a quantifier | x*y |
| .*.*.*foo | Several unbounded wildcards in sequence | .*foo |
Supported
- Ordered rule chains — each rule sees the previous result
- Full JavaScript regex with capture groups ($1, $2)
- Unicode-aware whole-word matching
- Catastrophic-backtracking detection before execution
- Per-rule match counts, so you can see which rule did nothing
Limits and trade-offs
- Backtracking detection is a heuristic. It catches the common shapes and can occasionally refuse a pattern that would have been fine.
- No lookbehind on very old Safari. Whole-word mode falls back gracefully but check the result if you are on an older browser.
- Replacements are literal apart from $1-style group references. To insert a literal $1, write $$1.
Last verified August 2026 · benchmarks re-run each quarter.
Frequently asked questions
How do I use capture groups in the replacement?
Turn on regex mode, wrap part of the pattern in parentheses, and refer to it as $1 in the replacement. For example, find `(\w+)@(\w+)` and replace with `$2 — $1` swaps the two halves of an email around the @.
What is the difference between one rule and a list of rules?
A list runs top to bottom, and each rule operates on the output of the one before it. That matters: stripping a prefix and then collapsing separators gives a different result from doing it the other way round. Most online tools make you run each pass manually.
Why did the tool refuse my regular expression?
It detected a shape that can backtrack exponentially — usually a quantifier applied to a group that already repeats, like (a+)+. On a long input that takes effectively forever and freezes the tab. Rewrite it with a bounded quantifier or turn regex mode off.
Does "whole words only" work in languages other than English?
Yes. It uses Unicode letter and number properties rather than the \b word boundary, which is defined against ASCII and gives wrong answers in Bangla, Arabic, Greek and Cyrillic.
Can I replace across line breaks?
Yes, in regex mode. Use \n to match a newline. Note that the input may contain CRLF line endings, in which case match \r?\n.
Is there a size limit?
Five megabytes. Past that, browser regex stalls the page whatever the pattern is, so the tool refuses rather than appearing to hang.