Klyvoratools
Advertisement

Find and Replace

Replace text with optional case matching and regular expression support.

← All Tools
Advertisement

About the Find and Replace

Enter the text to find and its replacement and every match is replaced instantly. Turn on match case for exact capitalisation or use a regular expression for advanced patterns.

Why use find and replace

Editing repeated text by hand is slow and easy to get wrong. Find and replace changes every occurrence at once. You can update a product name throughout a document, fix a common misspelling, change a date format, swap a domain in a list of links, or clean up text pasted from another source. The result appears instantly, so you can adjust and try again.

Match case and regular expressions

By default the search ignores capital letters, so cat matches Cat and CAT. Tick Match case to replace only the exact capitalisation. Regular expressions let you describe patterns instead of exact words: \d+ matches any run of digits and colou?r matches both colour and color. The tool uses JavaScript regex syntax, and in regular expression mode the replacement can use groups such as $1.

Safe editing tips

Check the match count shown under the result before you copy it, and test on a small sample first. If a word also appears inside longer words, such as cat inside category, use a pattern with word boundaries like \bcat\b. Leave the Replace field empty to delete every match. An invalid pattern shows an error message instead of changing your text. Keep the original until you are happy with the result.

Common examples

Turn double spaces into single spaces by finding two spaces and replacing them with one. Remove all digits with the pattern \d and an empty replacement. Change a word everywhere, such as an old brand name to a new one. After changing text, you can clean the list further with our Remove Duplicate Lines tool.

Before you replace everything

A good habit is to search first with an empty replacement and read the match count. If the number is higher than you expected, your search text is probably too short and is matching inside other words. Make it longer, add word boundaries, or switch on Match case, then run the real replacement. This simple check prevents most find and replace mistakes and saves you from repairing text afterwards.

Regular expression patterns worth knowing

A few simple patterns solve many jobs. The pattern \s+ finds any run of spaces, tabs or line breaks, so replacing it with a single space joins broken lines. The pattern \d{4} finds any four-digit number such as a year, and the symbols ^ and $ mark the start or the end of the whole text. Remember that characters such as . ? ( ) [ ] have a special meaning in regular expressions, so leave the regular expression option off when you are searching for ordinary text that contains them.

How to use it

  1. Paste your text.
  2. Enter what to find and what to replace it with.
  3. Copy the updated text and check the match count.

Frequently asked questions

Can I use regular expressions?

Yes. Tick the regular expression option and use JavaScript regex syntax.

Does it replace every match?

Yes. All matches in the text are replaced at once.

Advertisement