Literal Phrases and Regex Patterns
Replace nonoverlapping occurrences of a literal phrase or JavaScript regex pattern. Literal replacement keeps dollar signs exactly as typed. Regex replacement interprets capture and match tokens. Review a snapshot before copying it. Typical edits: a repeated phrase in a draft, a known literal marker removed without losing its whole line, or captured fields rearranged across independent plain-text matches.
Literal Dollars and Regex Captures
| Mode | Input / Find / Replacement | Output |
|---|---|---|
| Literal | cat / cat / $& | $& |
| Regex | cat / (cat) / [$1] | [cat] |
| Literal whole word | é été / é / E | E été |
Replacing Text in Four Steps
- Paste text, then enter Find and Replace with. An empty replacement deletes matches.
- Choose case sensitivity or literal whole-word boundaries. Regex enables its own multiline and dotAll options.
- Click Apply Replacement. Input and settings changes clear the old result.
- Review the match count and output, then Copy. Cancel stops pending processing.
How Search, Boundaries and the Worker Timeout Work
Search is global and Unicode-aware; case-insensitive is the default. Whole Word in literal mode rejects a match adjacent to a Unicode letter, number, mark or underscore. This boundary rule handles accented letters without promising language-specific word segmentation. It does not normalize canonically equivalent spellings. Regex mode ignores Whole Word and uses your pattern boundaries.
In regex mode, anchors target the whole input unless Multiline is on. DotAll lets a dot match line terminators. Unicode mode makes a dot match one code point, not a complete grapheme cluster. Enter pattern text such as \d+, without slash delimiters or trailing flags. Source separators are preserved unless your matches replace them.
Apply runs in an isolated worker with a two-second timeout, including startup. Cancel, edits and unmount terminate work; errors clear the result while keeping input. No main-thread regex fallback runs if workers are unavailable. Limits: 1,000,000 input UTF-16 units, 20,000 physical lines, 1,000 Find units, 10,000 replacement units, 100,000 candidate occurrences and 5,000,000 output units.
Where a Replacement Goes Wrong
Empty Find leaves the input unchanged with zero matches. Invalid regex is an error, not a successful zero-match result. Regex dollar tokens such as $&, $1, $$, the source-prefix token and the source-suffix token can change output substantially; expansion and match-count limits may stop the job. Zero-width matches advance by a code point, preventing an endless loop. This is not a syntax-aware refactor, HTML sanitizer or a grapheme-safe character editor.
Start with Literal and keep a source copy. Turn on Whole Word when its explicit boundary rule fits your data; add Multiline only when anchors should apply across rows. Review JavaScript replacement-token semantics for captures and unmatched groups. Use Remove Lines by Keyword to remove complete rows or Word Frequency to inspect repeated terms first.