Skip to content
Documents·1 min read·

Find and replace

Replace every exact match in a paste, or use a regular expression when the match is a pattern.

The answer

Literal mode replaces the exact text you type, every time it appears. Pattern mode compiles a regular expression and replaces each match with the replacement as plain text.

Result

Result

color and color

Replacements

2

What do you want to do next?

How this works

Literal mode does not treat dots, stars, or brackets as patterns. The replacement is inserted as you typed it, including when it contains a dollar sign.

Pattern mode uses JavaScript regular-expression syntax without flags. Nested open-ended quantifiers are refused so a pattern cannot stall the page. The replacement is still literal: it does not expand backreferences.

Practical steps

  1. 1

    Paste the full text.

  2. 2

    Type the exact find text, or switch to a pattern if you need a pattern.

  3. 3

    Check the replacement count before you copy the result back into the draft.

Examples

  • Replace “colour” with “color”

    Each exact “colour” changes, and the count tells you how many changed.

Common mistakes

  • ×

    Leaving pattern mode on when the find text includes a dot that you meant as a period.

Frequently asked questions

Can the replacement be empty?

Yes. An empty replacement deletes each match.

Are matches case sensitive?

Yes. “Cat” does not match “cat” in either mode.

Continue reading