Find and Replace: How to Search and Replace Text

Learn how to use find and replace effectively, when to use regex, and how to handle common replacement patterns.

4 min read Updated 2026-07-10

Quick Answer

Find and Replace, also written find replace or called search and replace, searches your text for a pattern and replaces every occurrence with a different string. This is how to replace a word everywhere at once: it does a bulk replace across the whole input, so replace all changes every match in a single pass. Use it to replace text, do a bulk edit, or swap a term across a long document. By default the search is case-insensitive and treats the find term as plain text. You can enable case sensitivity, whole-word matching, or regex mode for advanced patterns.

Try Find and Replace →

How to Use Find and Replace

  1. Paste your text into the Source Text area.
  2. Type the word or phrase you want to find in the Find field.
  3. Type the replacement text in the Replace field (leave empty to delete matches).
  4. The Result area updates instantly with all replacements applied.
  5. Copy or download the result.

Toggle Options

Aa, Case Sensitive. When enabled, the search matches exact capitalisation. "Hello" will not match "hello". When disabled (default), matching is case-insensitive. Note that case-sensitive matches miss differently-cased copies, so turn this off when you want every casing replaced.

.* Regex Mode. When enabled, the Find field accepts a regular expression. This enables powerful patterns like \d+ for numbers, \s+ for whitespace, and ^ / $ for line boundaries. Regex mode is how you match all occurrences of a variable pattern in one pass.

\b Whole Word. When enabled, the search only matches when the term appears as a complete word, not as part of a longer word. This matters because replace all changes every match, including inside other words: searching for "cat" with whole word on will match "cat" but not "category".

Useful Regex Examples

  • Remove extra spaces: Find \s+ → Replace (single space)
  • Remove blank lines: Find ^\s*\n → Replace (empty)
  • Swap two words: Find (\w+)\s(\w+) → Replace $2 $1
  • Add line numbers: Find ^ → Replace
  • Remove HTML tags: Find <[^>]+> → Replace (empty)

Common Mistakes

Find and Replace vs Manual Editing

Find and replace vs manual editing comes down to scale and reliability. Editing by hand is fine for one or two changes, but to swap a term across a long document it is slow and easy to miss an occurrence. Search replace does the whole job in one pass and matches all occurrences, so nothing is skipped. The trade is control: manual editing lets you judge each spot, while a bulk replace applies the same rule everywhere. Use whole-word or case-sensitive options to narrow a bulk edit when a blanket replace all would be too broad.

You May Also Need

You may also need

Next steps

Alternatives

Continue Learning