Find and Replace Text

Find every match in your text, change it to something else, and see exactly how many replacements were made.

Ce contenu est en anglais.

Exemples détaillés

Replacing a whole word only

Text "The cat sat on the category mat." with cat replaced by dog and whole words only turned on

The dog sat on the category mat. 1 replacement

Whole words only stops "cat" changing inside "category", so the count reflects only the exact word.

Masking numbers with a pattern

Text "Order 42 ships in 3 days" with the pattern \d+ replaced by #

Order # ships in # days 2 replacements

In pattern mode the search is a rule, so any run of digits matches, and the count shows how many were changed.

À propos de Find and Replace Text

Find and replace is one of the most useful editing jobs, and it saves hours on long documents. It lets you change a name across a long document, correct a term that has been spelled wrongly many times, or swap a product code for a new one without reading every line. Doing it by hand is slow, and it is easy to miss a match. This tool finds every occurrence of the text you enter, replaces it with what you choose and tells you how many changes it made, so you can check the total against what you expected.

The options cover the most common needs. You can ignore capital letters or match them exactly, limit matches to whole words so that a short word does not change inside a longer one, and turn on pattern matching for advanced searches such as any number or one of several alternatives. In pattern mode, the replacement can refer to parts of each match. Leave the replace field empty to delete every match. The result appears in its own box, where you can copy it straight away.

Comment utiliser Find and Replace Text

  1. Paste or type the text you want to change into the box.
  2. Enter the text to find and the text to replace it with.
  3. Choose the capital letter option, and turn on whole words or pattern matching if you need them.
  4. Check the count of replacements, then copy the result.

Usages courants

  • Changing a name or product code throughout a document
  • Correcting a spelling that appears many times in a file
  • Removing a repeated phrase or symbol from a list
  • Updating dates or reference numbers in a set of notes

Questions fréquentes

How do I find and replace text online?

Paste your text into the top box, type the text to find in the Find box and type the new text in Replace with. The result appears below as you type, and the summary shows how many replacements were made. When it looks right, use the copy button to take the result to your document or website.

Does find and replace match capital letters?

By default, the search ignores capital letters, so Cat, cat and CAT are all found. Choose Match capital letters exactly if you only want the exact case you typed. This is useful for names or codes where capitals matter, such as a product code that uses letters and numbers in a fixed format.

What does the whole words option do?

Whole words only makes sure the match is a complete word rather than part of a longer one. Without it, searching for cat would also change the first three letters of category. With it turned on, cat matches only the separate word and leaves category alone. This makes the tool safer when you are replacing short words or common letter groups.

What is a pattern search and when should I use it?

A pattern search describes a set of text rather than one exact phrase, for example any run of digits or one of several words. Use it when plain text is not enough. In a pattern, the replacement can refer to matched parts using $1, $2 and so on. If a pattern is not valid, the tool explains what is wrong instead of changing your text.

Will find and replace change text I did not expect?

It changes every match it finds, including matches inside longer words unless whole words is turned on. Check the count before you copy, and read a few lines of the result to be sure. The original text in the top box is never changed, so you can adjust the find or replace text and try again at any time.