All tools · Text tools

Find & Replace

Replace text or regex matches across a block of text.

Free to use, no sign-up required. Find & Replace is one of 198 tools built into Xenition, alongside a chat that can use them for you.

Replaces every match of a word, phrase or regular expression in a block of text. Useful for renaming a term across a document, swapping date formats, or cleaning pasted data.

How to use Find & Replace

  1. Paste the text into the Text box.
  2. Type what to look for in Find and the new text in Replace with. Leave Replace with empty to delete the matches.
  3. Tick regex to treat Find as a JavaScript regular expression.
  4. Copy the result shown below.

How it works

The tool uses JavaScript’s replaceAll, so every match is replaced, not just the first. Plain matching is exact and case-sensitive. In regex mode the pattern is compiled with only the global flag, so it is also case-sensitive unless you write the pattern to allow both cases, for example [Hh]ello. Capture groups can be reused in the replacement as $1, $2 and so on. An invalid pattern shows the error instead of a result.

Example

With regex ticked, Find (\d{4})-(\d{2})-(\d{2}) and Replace with $3/$2/$1 turns 2024-01-15 into 15/01/2024.

Questions about Find & Replace

Can I do a case-insensitive replace?

Not with a switch. Plain mode and regex mode both match case exactly, so use a character class such as [Cc]olor in regex mode to cover both spellings.

Why does a dollar sign in my replacement act differently in regex mode?

In plain mode the replacement is inserted exactly as typed, so replacing 5 with $&0 in “cost $5” gives “cost $$&0”. In regex mode JavaScript rules apply: $& inserts the whole match, $1 a group, and $$ a single dollar sign.

Use it from chat

You do not have to open Find & Replace to use it. Ask Xenition in plain language and it runs the right tool, then carries the answer into whatever you are working on — a document, a spreadsheet, a deck.

Related tools