Handitab

Find and Replace Text

Find and replace every occurrence of a word, phrase, or regular expression in your text, with optional case-insensitive matching.

About Find and Replace Text

Find and replace is an operation that swaps every occurrence of a search term in a text with another string. This tool replaces all matches at once and reports how many were changed. Plain mode treats the search text literally. Regex mode uses JavaScript regular expression syntax with the global flag, and capture groups can be reused as $1, $2. Matching is case-insensitive by default. The multiline and dotAll flags cannot be set.

How to use Find and Replace Text

  1. Type or paste into the "Input text" box, or press "Use example" to try it with sample data.
  2. Set "Find", "Replace with", "Use regex" and "Ignore letter case" if the defaults do not fit.
  3. The result appears below and updates as you type.
  4. Copy the result with the copy button, or download it as a file where that is offered.

Questions about Find and Replace Text

How do I reuse part of the match in the replacement?

Tick "Use regex", wrap the part in parentheses, and refer to it as $1 in the replacement. For example, find (cat|dog)s and replace with one $1. In plain mode, $1 is inserted literally.

Which regex syntax does it use?

JavaScript (ECMAScript) regular expressions, as implemented by your browser. Lookahead, named groups, and Unicode escapes work. PCRE-only features such as possessive quantifiers and recursion do not.

Runs in your browser. Page last updated .

More text tools

All 56 text tools