Find and replace across a text

Rename a term everywhere it appears, strip a prefix from every line, or reshape patterns with a regular expression.

Tools used in this guide

The job

A product name changed, a column prefix needs stripping, or every “color” should become “colour”. Pasting the text and running one replace is faster — and less error-prone — than editing each line.

Literal first, regex when needed

Literal mode treats the find text as plain characters, so periods and brackets match themselves. Switch on regular expressions only when the pattern varies: `-(\d+)px` → `$1px` strips the dash from every pixel value while keeping each number.

Replacement strings support `$1`, `$2`… for captured groups and `$&` for the whole match — handy for wrapping rather than deleting: find `https?://\S+`, replace `<$&>`.

What to watch

Case-insensitive matching still replaces the original casing with your replacement text verbatim. Whole-word matching uses ASCII word boundaries and does not apply to Japanese or other non-ASCII text. Always glance at the replacement count — zero means the pattern never matched.