Find and Replace Text — Literal Search and JavaScript Regex

Find matching text, highlight it safely and replace all matches. Choose case sensitivity, Unicode word boundaries or JavaScript regular expressions.

🔒 Local processing
⚡ Free to use
🌐 Runs in your browser
📦 See output options
⚡

Find and Replace Text — Literal Search and JavaScript Regex

Tool workspace

Ready

Loading tool...

  1. Paste text and enter a search term.
  2. Choose case sensitivity, whole-word matching, or regex mode.
  3. Use Find All to inspect matches, or enter replacement text and choose Replace All.
  4. Review and copy the result; editing inputs clears the old result.

Search first, then replace

Use Find All to highlight matches without interpreting the source as HTML. Replace All produces a separate text result and leaves the original input intact. Plain search treats punctuation literally. For example, replacing cat with $& in plain mode writes the two characters $&; it does not reinsert the match.

Regular expressions and whole words

Regex mode accepts a JavaScript pattern without surrounding / delimiters. Matching uses the Unicode flag and is global; case-insensitive matching is enabled unless you select Case sensitive. Regex replacements support JavaScript tokens such as $& and $1. Whole word applies only to plain search and checks adjacent Unicode letters, numbers, combining marks and underscore. It is not a language-specific word segmenter, especially for text without spaces.

Practical limits

Search runs in a separate worker with a two-second timeout so a slow pattern can be stopped. Input and replacement are each limited to 200,000 UTF-16 units, patterns to 2,000, and results to 10,000 matches. A conservative four-million-unit expansion check may reject large regex replacements. Character counts are UTF-16 units, not visible graphemes; lines are separated by newline characters. Invalid or excessive searches show an error instead of retaining a previous result. The tool does not edit files on disk.

Frequently asked questions

Do I include / around a regex?

No. Enter the pattern only and enable regex mode.

Does replacement text interpret $1?

Only in regex mode. Plain search inserts replacement text literally.

Does whole-word matching support Arabic?

It checks Unicode letters and marks, including Arabic, but is not a dictionary-based word segmenter.