Find and Replace
Find and replace text with optional regex, case-sensitivity, and live match count - in your browser.
Paste text, type a find pattern and a replacement, see matches highlighted and counted in real time. Optional regex (PCRE-style: groups, alternation, lookaheads), case-insensitivity, and whole-word mode. Nothing is sent to a server.
How to use it
Paste your text and type the find pattern
Match count updates as you type. Toggle regex / case / whole-word as needed.
Type the replacement
Plain text, or back-references like $1 in regex mode. Empty replacement deletes the matches.
Copy the result
Output appears in the right pane. Copy back to wherever you got the text from.
What is it?
A find-and-replace tool scans a body of text for occurrences of a pattern and substitutes each with a chosen replacement. Plain-text mode does literal string matching; regex mode interprets the pattern as a JavaScript regular expression with groups, alternation and look-arounds. The replacement supports back-references like $1, $2 when regex is on.
When to use it
Renaming a variable across a code snippet pasted from somewhere; switching every 'colour' to 'color' for an American audience; pulling phone numbers out of free-text and normalising the format; replacing curly quotes with straight quotes before committing to a database. Any one-off text transformation that's faster than opening an editor.
Common mistakes
Forgetting to escape regex metacharacters in plain-text mode - dot, parens, plus, asterisk are literal in plain-text but special in regex. Using greedy quantifiers when lazy was needed: '.*' matches as much as possible; '.*?' matches as little. And not previewing match count before hitting replace - it's the single best sanity check that the pattern does what you think it does.
FAQ
- Does it support regex?
- Yes - toggle 'Regex' and the find pattern becomes a JavaScript regular expression. Capture groups are addressable in the replacement as $1, $2, etc.
- What about replacing across newlines?
- In regex mode, the 's' flag (dotall) is on by default so '.' matches newlines. Plain-text mode just looks for literal substrings, so newlines in your find pattern are matched as-is.
- Can I replace with newlines?
- Yes. Type \n in the replacement (regex mode) and it expands to an actual newline. In plain-text mode, paste a real newline into the replacement field if your input supports it, or use regex mode.