Find & Replace Text

Search and replace across a block of text, with plain-text or full regular-expression matching, live match highlighting and capture-group references. The text stays in your browser — nothing is uploaded.

🔒 Processed locally — nothing is uploaded

Copied!
Advertisement

Related tools

Plain find-and-replace swaps one exact string for another. Regular expressions let you match by pattern instead — any digit, a word at the start of a line, text between two markers — and reuse pieces of what you matched in the replacement.

Plain text vs regex

In plain text mode, whatever you type in "Find" is matched literally — special characters like . or * have no meaning. In regex mode, the "Find" box is a JavaScript regular expression: \d+ matches a run of digits, \bfox\b matches "fox" as a whole word, colou?r matches "color" or "colour". If your pattern is invalid, the tool shows the error instead of a result.

Capture groups and $1

Parentheses in a regex capture the part they match. You can drop those pieces back into the replacement with $1, $2, and so on. For example, find (\w+)@(\w+) and replace with $2 / $1 to swap the two halves of a handle. $& is the whole match; $$ is a literal dollar sign.

💡 Tip: "Apply to text ↑" writes the result back into the input box, so you can run several passes — for instance normalize whitespace, then fix quotes, then renumber a list.

What the flags do

Common real-world tasks

Frequently asked questions

Is my text uploaded?

No. The matching and replacing happen entirely in your browser on the text in the box. Nothing is sent to a server; closing the tab discards it.

Which regex dialect is this?

JavaScript's (ECMAScript). It's close to PCRE for everyday patterns — \d, \w, \s, quantifiers, alternation, lookahead and named groups all work. Some PCRE-only features like recursion and possessive quantifiers don't.

Can I use it on a large file?

You can paste large text, but the highlighted preview is capped for performance — the match count and the full replacement still cover the whole text. For very large files a desktop editor is a better fit.

How do I match a literal dot or bracket in regex mode?

Escape it with a backslash: \., \(, \[. Or switch to plain-text mode, where nothing is special.

What's the "Common pattern" dropdown?

A shortcut for regexes people look up constantly — email addresses, URLs, IPv4 addresses, dates, hex colors, HTML tags and a few whitespace cleanups. Picking one fills in the Find field (and Replace, when there's an obvious default like stripping HTML tags) with a working pattern you can then tweak.

Can I see how many matches there are without replacing anything?

Yes — the match count above the preview updates live as you type your pattern, before you click Replace, so you can confirm it's matching what you expect first.

Does it support lookahead and lookbehind?

Yes, since it uses JavaScript's regex engine: (?=...) and (?!...) for lookahead, (?<=...) and (?<!...) for lookbehind. These let you match a pattern only when it's followed or preceded by something else, without including that context in the match itself.

Advertisement