Find & Replace
Find & replace with full regex support: $1 capture groups, case and whole-word options.
This find and replace tool runs entirely in your browser.
Nothing you paste is uploaded anywhere. Turn on regex mode and
it goes well beyond a basic text swap: full JavaScript regular
expressions with $1-style capture-group
backreferences, named groups, whole-word matching, case
control, and a live count of how many spots changed.
How to use
- Paste or type your source text into the Input panel, or use the Paste, Sample, and Clear buttons in its header.
- Fill in Find and Replace with. The result updates as you type, and the count above the result panel tells you how many replacements were made.
- Toggle Regex, Match case, or Whole word as needed. The Regex cheatsheet under the toolbar lists the most common pattern tokens with examples.
- Click Copy to grab the result, or Download to save it as a text file.
Capture groups: a worked example
Each pair of parentheses in a regex saves whatever it matched,
and you can paste those pieces back into the replacement with
$1, $2, and so on. Say you want to
flip user/domain pairs around: turn on Regex, set
Find to (\w+)@(\w+) and Replace with to
$2.$1. This input:
alice@wonderland
bob@builder becomes:
wonderland.alice
builder.bob
Here $1 holds the part before the
@ and $2 the part after, so
$2.$1 swaps them with a dot in between. Also
supported: $& for the entire match (handy
for wrapping, e.g. **$&**),
$<name> for named groups like
(?<year>\d\d\d\d), and $$ for
a literal dollar sign.
Edge cases and notes
- Whole word wraps your pattern in word
boundaries as
\b(?:pattern)\b. The non-capturing group means an alternation likecat|dogis treated as one unit, and your$1,$2numbering is not shifted by the wrapper. - Match case is off by default, so
searching for
thealso hitsTheandTHE. Turn it on for exact-case matching. -
With Regex off, both fields are plain
text: special characters like
.and*are matched literally, and$1in the replacement is inserted literally rather than expanded. - An invalid pattern (say, an unclosed bracket) shows the parser error in the result panel instead of failing silently.
FAQ
More questions? Browse the full FAQ.
Want to pull the matches out of the text instead of replacing them? Use the pattern extractor to list emails, URLs, or custom regex matches. And to double-check exactly what changed, paste the before and after into the text diff tool for a line-by-line comparison.