Advanced Find & Replace
Simple text, regex with capture groups, multi-rule batch replace, and diff preview. All in your browser.
How to Use Advanced Find & Replace
- Choose a mode — Simple for plain text, Regex for pattern matching, Multi-Rule for batch replacements, or Preview to see a diff before applying.
- Enter your find pattern and replacement text in the fields above the input area.
- Paste your text into the left panel. Replacements apply automatically.
- Review the output on the right or see the highlighted diff in Preview mode.
- Copy or download the result using the buttons above the output.
Mode Details
Simple Mode
Finds all occurrences of plain text and replaces them. By default, case-sensitive. Enable "Case Sensitive" to force exact case matching. Enable "Whole Word Only" to match only when the pattern appears as a complete word (surrounded by word boundaries, not within a longer word). Leave the Replace field empty to delete all matches.
Regex Mode
Full regular expression support using JavaScript's RegExp engine. The find field accepts a regex pattern. Use capture groups (group) and backreferences $1, $2 in the replacement. For example, to swap first and last name: find (\w+)\s+(\w+) and replace with $2, $1. All replacements are global (replace all matches). Special replacement patterns like $$ (literal $), $& (whole match), $` (before match), $' (after match) are all supported.
Multi-Rule Mode
Define multiple find/replace pairs as a JSON array. Each rule is ["find", "replace"]. Rules are applied in order — the output of each rule becomes the input of the next. This allows chaining transformations: first normalize line endings, then replace all URLs, then clean up whitespace. Rules in Multi-Rule mode are treated as plain text (not regex). For regex batch rules, switch to Regex mode and apply one at a time.
Preview / Diff Mode
Shows a word-level diff highlighting what will be removed (red, strikethrough) and what will be added (green). Use this mode to verify complex regex replacements before committing. The diff uses a simple token-based comparison of lines, so changes are shown in context. This is especially useful when working with large texts where a wrong replacement could be hard to spot in the plain output.
Regex Reference
\d— digit,\w— word character,\s— whitespace.— any character (except newline without dot-all),*— zero or more,+— one or more^— start of line (with multiline flag),$— end of line(group)— capture group,(?:group)— non-capturing group$1,$2— backreferences in replacement[abc]— character class,[^abc]— negated class\b— word boundary,|— alternation (OR)