TextToolboxTextToolbox
HomeText Cleaners & ModifiersFind and Replace Tool

Find and Replace Tool

Replace literal phrases or JavaScript regex matches with explicit dollar-token semantics, Unicode boundary options and a reviewed Apply snapshot.

Built by Saurabh Kumar

Quick Answer

Search globally with Unicode mode and optional case sensitivity. Literal replacement keeps dollar tokens literal; regex supports captures, multiline anchors and dotAll. Whole Word uses adjacent Unicode letters, numbers, marks and underscore, not language segmentation. Apply runs in a cancellable worker with visible errors.

Literal replacement keeps dollar tokens literal. Regex interprets them. All searches use Unicode mode. Whole Word checks adjacent Unicode letters/numbers/marks/underscore; it is not language segmentation. Input: 1,000,000 units / 20,000 lines; Find: 1,000 units; replacement: 10,000; candidates: 100,000; output: 5,000,000 UTF-16 units.

Click Apply to review a result. Background requests stop after two seconds; edits or Cancel stop pending work and clear the old output. Your input stays unchanged.

No current result. Apply after changing input or settings.

If Copy fails, select the output and copy manually. An empty result is shown in the counts; there is no nonempty text to export.

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

The same replacement field has two explicit meanings
ModeInput / Find / ReplacementOutput
Literalcat / cat / $&$&
Regexcat / (cat) / [$1][cat]
Literal whole wordé été / é / EE été

Replacing Text in Four Steps

  1. Paste text, then enter Find and Replace with. An empty replacement deletes matches.
  2. Choose case sensitivity or literal whole-word boundaries. Regex enables its own multiline and dotAll options.
  3. Click Apply Replacement. Input and settings changes clear the old result.
  4. 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.