Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 42 ยท Text and Formatting

Find and Replace in Word: Wildcards, Formats and Special Characters

Use Find and Replace in Word: the Navigation Pane, match options, special codes like ^p and ^t, formatting searches, wildcards and clean-up recipes for messy text.

Find and Replace is one of the most powerful and least used tools in Word. Beyond fixing a misspelled name, it can remove double spaces, convert line breaks to paragraphs, change every instance of a font and rewrite patterns with wildcards. Learn it once and large clean-ups take seconds.

Find

Press Ctrl+F to open the Navigation Pane with a search box. Matches are highlighted in the text, listed in the Results tab, and you can click a result to jump to it. Use the magnifier's drop-down for Advanced Find, which opens the full dialog (Ctrl+H, tab Find) and also searches for graphics, tables, footnotes, comments, fields and more.

Press Enter (or F4 after closing the dialog with Shift+F4) to move to the next hit.

Replace

Ctrl+H (Home > Replace) opens the dialog:

  1. Find what: the text to find.
  2. Replace with: the new text (leave empty to delete the matches).
  3. Replace changes the current hit and moves on; Replace All changes everything; Find Next skips a hit.

Always scan the first few matches before using Replace All, and remember Ctrl+Z undoes a Replace All in one step. Click More >> for the options.

Match options

Option Effect
Match case Word does not match word
Find whole words only cat ignores category
Use wildcards pattern matching (see below)
Sounds like (English) their finds there
Find all word forms (English) run finds ran, running
Match prefix / suffix beginning or end of a word
Ignore punctuation / white-space characters tolerant matches

Special characters

Click Special in the dialog or type the codes:

Code Meaning
^p paragraph mark
^l manual line break (Shift+Enter)
^t tab
^m manual page break
^b section break
^w any white space
^# / ^$ / ^? any digit / any letter / any character
^& (in Replace with) the found text itself
^c (in Replace with) the clipboard contents

Recipes:

  • Remove double spaces: find (two spaces), replace with (one), click Replace All repeatedly until zero.
  • Convert manual line breaks to paragraphs: find ^l, replace with ^p.
  • Remove empty paragraphs: find ^p^p, replace with ^p and repeat. (Better to fix spacing with paragraph settings.)
  • Turn tabs into spaces: find ^t, replace with a space.

Finding and replacing formatting

Click Format at the bottom of the dialog (with the cursor in Find what) and choose Font, Paragraph, Style and others. To find every blue bold phrase and make it red: set Find format to blue bold, Replace format to red, leave both text boxes empty. Use No Formatting to clear the rules before the next job. You can also find all text in a particular style: a quick way to replace one style with another across the document.

Wildcards

Tick Use wildcards and Word reads characters as patterns. Special symbols:

Pattern Meaning
? any single character
* any string of characters
[abc] one of the listed characters
[a-z] one character in a range
[!x] any character except x
{n,m} n to m repetitions of the previous item
@ one or more of the previous item
< and > beginning / end of a word
(โ€ฆ) and \1 group and refer to it

For example, swap "Surname, Firstname" to "Firstname Surname": find ([A-Z][a-z]@), ([A-Z][a-z]@) and replace with \2 \1. Wildcards differ from regular expressions: no \d or +, and many symbols need a backslash to be literal (\?, \*).

Word's wildcard language is its own. It is case-sensitive when wildcards are on, and Match case is forced. Test on a copy of your document, and run one replacement before using Replace All.

Stand-in: Find and Replace with patterns

Word wildcards cannot run here, so the stand-in uses JavaScript regular expressions, which cover the same ideas: [A-Z][a-z]+ for [A-Z][a-z]@, and $2 $1 for \2 \1.

JS Stand-in: swap names and clean spaces

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Stand-in: special-code recipes

JS Stand-in: ^l to ^p, ^t to space, and Match case

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Safe habits

  • Search with Find All or the Navigation Pane first to see what will change.
  • Turn on Track Changes (Review tab) before a big replacement to review each change.
  • Use Replace All in a copy of the file when working with wildcards.
  • After a formatting search, click No Formatting and clear the box so the next search is not constrained.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which shortcut opens the Replace dialog?

    Ctrl+H is Replace, Ctrl+F opens the Navigation Pane, Ctrl+G is Go To.
  2. 2. What does ^p mean in Find and Replace?

    ^p is the paragraph mark; ^m is a manual page break.
  3. 3. How do you find all text in a certain color and replace the color?

    Formatting-only replacements change the look without touching the words.
  4. 4. In Word wildcards, what does * match?

    • matches any string; ? matches a single character.

Summary

  • Ctrl+F searches in the Navigation Pane; Ctrl+H opens Replace with options.
  • Special codes (^p, ^l, ^t, ^m) fix structural problems; Format finds and changes styles and fonts.
  • Wildcards work with groups (...) and \1; test before Replace All.
  • Undo (Ctrl+Z) reverses a Replace All.

Next: Hyperlinks, Equations, Symbols and Other Insertions