twoodo
/

Home/Tools/Text & developer utilities

Find and Replace

Plain text or regular expressions, replacing every occurrence.

Plain text by default

Without the regex option, what you type is matched literally. That means a dot is a dot and a question mark is a question mark, rather than the special meanings they carry in a pattern. For most replacements this is what you want and it avoids a class of surprising results.

What the regex option adds

With it on, you can use capture groups and refer to them in the replacement with $1, $2 and so on. That turns find-and-replace into a reformatting tool:

  • Find (\d{4})-(\d{2})-(\d{2}), replace with $3/$2/$1 to flip ISO dates into day-first format.
  • Find \s+$ with nothing in the replacement to strip trailing whitespace.
  • Find (\w+), (\w+), replace with $2 $1 to turn "Surname, Forename" into "Forename Surname".

The regex tester is the place to check a pattern before using it here.

Every occurrence is replaced

There is no step-by-step confirmation. That is faster and it is worth being deliberate about the search term, particularly with short words: replacing "in" without a word boundary also hits "point", "inside" and "thing".

Use \bin\b with the regex option to match whole words only.

Common uses

  • Renaming something throughout a document.
  • Reformatting dates or names with capture groups.
  • Stripping unwanted characters from pasted text.
  • Converting delimiters — tabs to commas, for instance.

Questions people ask

Does it replace every occurrence?

Yes, all of them at once. There is no step-by-step confirmation, so be deliberate with short search terms.

How do I use capture groups?

Turn on the regex option, wrap part of the pattern in brackets, and refer to it as $1 in the replacement.

How do I match whole words only?

Use the regex option with \\b around the word — \\bin\\b matches 'in' but not 'inside'.

Why is my replacement matching too much?

Probably a short search term appearing inside longer words. Word boundaries fix it.

Your text stays in the page

This matters more here than on most tools. People paste API keys into hash generators, customer data into CSV converters, contract wording into diff checkers and configuration into JSON validators. Almost every site offering these sends your input to a server to process it.

Nothing here is transmitted. The work happens in your browser, this site is static files with no server behind it, and the about page lists every request the site makes, read live from your own browser so you can check rather than trust.