Find and Replace Tool with Regex Support
Search and replace text in bulk with plain-text or regular expression matching, capture groups ($1, $2), a case-sensitive toggle and a live match count.
Runs in your browser. No data leaves your device.
About this tool
Finds and replaces text in a document, with plain-text or JavaScript regular-expression matching. It shows a live match count and an updated result as you type. Use it for bulk edits such as renaming terms, reformatting data or regex cleanups.
Features
- Plain-text mode: the search string is escaped and every occurrence is replaced
- Regex mode: full JavaScript RegExp syntax, applied with the global and multiline flags, so ^ and $ match at the start and end of every line
- In regex mode the replacement supports JavaScript patterns such as $1, $2 and amp;, and \n / \t insert a line break / tab (type \\n for a literal backslash-n); in plain mode the replacement is inserted exactly as typed
- Match case toggle (off by default, so matching is case-insensitive unless enabled)
- Live match count ("N matches found"); searches run in a background worker, so typing stays smooth
- Invalid regex shows an "Invalid pattern" error and leaves the text unchanged
- A pattern that runs longer than 2 seconds (heavy backtracking) is stopped with a "This pattern took too long" message instead of freezing the tab
- Copy and pipeline buttons on the result; Clear button on the input
How to use it
- Paste your text into Input Text.
- Type what to find and what to replace it with.
- Toggle Regex or Match case if needed.
- Check the match count and copy the Result.
Inputs
- Text, a find string or regex pattern, and a replacement string (can be empty to delete matches)
Outputs
- Text with all matches replaced, plus a match count
Limits and notes
- Always replaces all matches; there is no step-by-step or single replacement.
- Flags are fixed: g and m always, i unless Match case is on; there is no dotAll (s) option, so . does not match a line break.
- Only \n, \t and \\ are escapes in the replacement; other backslashes are kept as typed. Plain mode has no escapes.
- Safari's regex engine gives up on a runaway match by itself after about a second and reports it as no match, so there the 2-second message may not appear.
- Text is not saved and nothing is uploaded.
Frequently Asked Questions
How does Find and Replace work?
In plain text mode, your search string is escaped and turned into a global regular expression; in regex mode, your pattern is used as-is as a JavaScript RegExp with the global and multiline flags. The case-insensitive i flag is added unless Match case is on. String.replace() then swaps every match; in regex mode the replacement supports $1, $2 and
Does it support regular expressions?
Yes. Toggle regex mode to use full JavaScript regular expression syntax for complex search patterns. This lets you match patterns like email addresses, phone numbers, or repeated words. ^ and $ match at the start and end of each line, and a pattern that takes longer than 2 seconds is stopped with a message instead of freezing the page.
How do I replace with a line break?
In regex mode, type \n in Replace with for a new line and \t for a tab; type \\n if you want a literal backslash followed by n. For example, find ", " and replace with \n to put each item on its own line. In plain text mode the replacement is inserted exactly as typed.
Can I replace all occurrences at once?
Yes. Every match is replaced automatically and the result updates live as you type, along with a count of how many matches were found. There is no one-at-a-time replace mode.
Is it case-sensitive?
Not by default. Matching ignores case unless you turn on the Match case toggle.