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 uploadedRelated 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.
What the flags do
- Ignore case —
Foxalso matchesfoxandFOX. - Global — replace every match, not just the first (on by default).
- Multiline —
^and$match the start and end of each line, not just the whole text. - Dotall —
.also matches newline characters.
Common real-world tasks
- Cleaning up a CSV or log export. Collapse runs of spaces and tabs (
[ \t]+→ a single space — plain\s+would also swallow line breaks), strip Windows line endings (\r\n→\n, with "Interpret \n \t in the replacement" ticked), or drop a timestamp prefix from every line. - Normalizing quote styles. Swap curly quotes for straight ones (or the reverse) across a whole document pasted from a word processor.
- Reformatting data with capture groups. Turn
(555) 123-4567into555-123-4567, orlastname, firstnameintofirstname lastname, by capturing the pieces and rearranging them in the replacement. - Stripping markup. Remove HTML tags (
<[^>]+>) from pasted content before dropping it somewhere that only wants plain text.
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.