Skip to content
AdeptBay

How to use the Find and Replace

Last verified 2026-08-09 · about 6 minutes to read

The short version

  • 1.Paste your text. Nothing is uploaded — the replacement runs in this browser tab.
  • 2.Enter what to find. Turn on regex for patterns, and use $1 and $2 in the replacement to reuse capture groups.
  • 3.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 this is worth getting right

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.

Method 1 — use the Find and Replace on this site

The fastest route. It runs entirely in your browser, so nothing is uploaded and there is no queue to wait in. No account is needed and there is no daily limit.

  1. Paste your text. Nothing is uploaded — the replacement runs in this browser tab.
  2. Enter what to find. Turn on regex for patterns, and use $1 and $2 in the replacement to reuse capture groups.
  3. 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.

Open the Find and Replace

Method 2 — do it without this site

Worth knowing, because a tool you cannot replace is a dependency rather than a convenience. Most tasks in the text division have a command-line or built-in equivalent; it is usually more setup and less convenient, but it works offline and it is scriptable, which matters once you are doing something a hundred times instead of once.

What this tool will not do

Every tool has an edge. These are ours for find and replace, stated up front so you find out here rather than halfway through a deadline:

  • 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.

Questions people ask

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.

Open the Find and ReplaceRegex, capture groups, and rule chains that run in order — with a guard against patterns that freeze the page.