Text

Find and Replace Text

Replaces every match across a block of text, by plain string, whole word or regular expression.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the text you want to edit.
  2. Fill in what to find and what to replace it with. Leave the replacement empty to delete every match.
  3. Choose whole words when renaming a column or a variable, so a short name is not matched inside a longer one.
  4. Select Replace all and check the count in the summary before you trust the output.

What find and replace does

The three matching modes exist because the plain one is not always enough and the powerful one is not always safe. A plain search finds your text anywhere, including inside longer words — replacing "id" plainly will happily edit the middle of "identity". Whole-word matching fixes exactly that, and is the right default for renaming a column or a variable.

Regular expression mode is there for the jobs the other two cannot do: capture groups referred to as $1 in the replacement, patterns anchored to the start or end of a line, and character classes. An invalid pattern is reported with the reason rather than silently matching nothing, and the summary always tells you how many replacements were made — zero is the answer you most need to see.

Frequently asked questions

Whenever the thing you are renaming is short. A plain replacement of "id" will edit the middle of "identity" and "invalid". Whole-word matching only replaces the term where it stands alone, which is what renaming a column or a variable needs.

Yes, in regular expression mode. A group captured in the pattern is referred to as $1, $2 and so on in the replacement, so you can reorder or reformat rather than only substitute. $& stands for the whole match.

First the case-sensitivity setting, then a trailing space in what you typed into the find box, then whether the text really contains what you think — a curly apostrophe is a different character from a straight one, and they look nearly the same in most fonts.