The Problem:
Find and Replace isn’t flexible enough! I need to check references to a bunch of different product codes, CP408 through CQ917. As you can imagine, searching for «C» with «Match case» on finds me every capital C in the document. I want a better way!
The Solution:
There are two ways you can do this. The easiest way is to search for c^$^#^#^#
, which finds a C followed by any single letter and then three digits. To find special items, use the codes explained in Table 3-1. You can enter them by clicking the Special button in the Find and Replace dialog box (see Figure 3-12) when the «Use wildcards» box is unchecked, but once you find how useful they are, you’ll find it quicker to type them.
Table 3-1. Special codes for Find and Replace
Code |
Meaning |
---|---|
|
A paragraph mark. |
|
A tab. |
|
Any single character (letter or number). For example, |
|
Any digit. For example, |
|
Any single letter (not a digit). |
|
A caret (the single caret is used to identify other codes). |
|
A section character (�). |
|
A paragraph character (-not a paragraph mark). |
|
A column break. |
|
An em dash (). |
|
An en dash (). |
|
An endnote mark. |
|
A field. |
|
A footnote mark. |
|
A graphic. |
|
A manual line break. |
|
A manual page break. |
|
A nonbreaking hyphen. |
|
An optional hyphen. |
|
A nonbreaking space. |
|
A section break. |
|
Whitespace (one or more spaces, one or more tabs, or a combination of the two). |
Figure 3-12. The Special pop-up menu in the Find and Replace dialog box provides an easy way to enter the codes for special items.
The other way is to use regular expressions
, or combinations of text and wildcards. Check the «Use wildcards» box and enter C[P-Q]
(in capitals, as it’s case-sensitive) in the «Find what» box, then click the Find Next button.
by updated Aug 01, 2016
Please Note:
This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Searching for Special Characters.
Written by Allen Wyatt (last updated September 1, 2018)
This tip applies to Word 97, 2000, 2002, and 2003
Word allows you to search not just for text, but also for special characters that normally do not print. If you are working with documents that use tabular material, you will find yourself searching for tab characters quite a bit. To search for tabs, follow these steps:
- Press Ctrl+F. Word displays the Find tab of the Find and Replace dialog box.
- Click the More button, if it is available. (See Figure 1.)
- In the Find What box, enter the text for which you want to search. For example, to search for a tab character enter ^t (it is important to use a lowercase t). Alternatively, you can click on the Special button and select a special character from the list.
- Set other searching parameters, as desired.
- Click on Find Next.
Figure 1. The Find tab of the Find and Replace dialog box.
Often, you will be searching for other special characters such as breaks and paragraph marks. It can be faster to remember these and type them in rather then looking them up all of the time. The following is a list of the more common special characters:
Special Character | Symbol | |
---|---|---|
Paragraph Marker | ^p | |
Manual Page Break | ^m | |
Section Break | ^b | |
Column Break | ^n | |
Em Dash | ^+ | |
En Dash | ^= | |
Graphic | ^g | |
Any Character | ^? | |
Any Digit | ^# | |
Any Letter | ^$ | |
White Space | ^w | |
Caret Character | ^^ |
You can also use many of these same special characters in the Replace With box when doing a search and replace operation. You cannot, however, use the special white space character (^w) in the Replace With box.
In addition, Word allows you to search for any character as long as you know its ASCII value. (You can find ASCII values for characters in the back of many programming books.) All you need to do is use the caret, followed by a zero and then the three-digit value of the character. For instance, if you wanted to search for a capital A, whose ASCII value is 65, you would use ^0065 as your search string.
WordTips is your source for cost-effective Microsoft Word training.
(Microsoft Word is the most popular word processing software in the world.)
This tip (10) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Searching for Special Characters.
Author Bio
With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. Learn more about Allen…
MORE FROM ALLEN
Resizing Your Table
Need to make your table a different size? It’s easy to do, using the same general technique you use when resizing a …
Discover More
Conditionally Playing an Audio File
You can add audio files to an Excel worksheet, but what if you want a particular audio file to play only when a value in …
Discover More
Automatically Adding Tabs in Footnotes
When you add a footnote to a document, Word’s normal formatting adds a space after the footnote number and before the …
Discover More
More WordTips (menu)
Searching for Special Hyphens
Word allows you to use a couple of different types of hyphens in your document, each with a different purpose. If you …
Discover More
Quick and Dirty Paragraph Count
Need to know how many paragraphs are in a document? You can use Word’s Find and Replace feature to get a count quickly.
Discover More
Special Characters in Pattern Matching
The most powerful search engine in Word use pattern matching, but the way you specify special characters in a …
Discover More
Wildcard characters and operators refine the search in Microsoft Word. Simple combinations of the
question mark and asterisk allow you to search various word forms. More advanced options like character
ranges and min/max occurrences make it even more powerful.
The question mark matches any single character; the asterisk matches any group of characters (commonly
called a text string). Word looks past the asterisk to see whether any other characters limit
the search.
For example, searching for wo*d finds text such as word, world, and
worshipped.
Press Ctrl+H to open Find and Replace dialog box:
To use wildcard characters, click the More > > button, and select the
Use wildcards checkbox in the Find and Replace dialog box:
These wildcards are handy for finding words that you don’t know how to spell.
For example, if you are not sure how to spell receive, you can type rec??ve. Word then locates
any word that begins with rec, followed by any two characters followed by ve.
Search Operators
- ? — Any single character.
For example, d?g finds dig, dog, and dug, but not
drug and ridge. - * — Zero or more characters: finds a word with the specified characters and zero or more
characters in place of *.For example, des*t finds descent, desert, destiny,
dessert, and destruct and even excludes the, codes — to. - < — Beginning of the word.
For example, <tel finds telemarketing, telephone, and
television, but not hotel and retell. - > — End of the word.
For example, ion> finds aggravation, inspiration, and
institution, but not ionic and bionomics. - @ — Preceding one or more: finds one or more of the characters immediately preceding the @
sign.For example, ^[email protected]^t finds one or more paragraph break marks followed by a tab mark.
- [] — One of the specified characters.
For example, b[aeiu]t finds bat, bet, bit, and but,
but not debt and boot. - [-] — Any character from the range.
For example, [a-m]end finds bend, fend, lend, and
mend (the first character in this case is a, m, or any letter between
them),
but not rend and end. - [!] — Not: finds the text but excludes the characters inside the brackets.
For example, t[!ae]ll finds till and toll but not tall and
tell. - [!a-z] — Any single character except the ones in the range inside the bracket.
For example, m[!o-z]st finds mast and mist, but not most or
must. - {n} — Exact number of occurrences: finds the specified number of occurrences of the letter
immediately before the {.For example, to{2} finds too and tool but not to.
- {n,} — Minimum number of occurrences: adding a comma after the number tells Word to look for
at least that number of occurrences.For example, a{4,} finds four or more of the letter a in a row.
Note: In this example, commas work as a list separator. If you see the Word message
that an invalid character has been used, your configurations use another symbol as a list
separator, usually, a semi-colon. Consequently, all list-delimiting commas need to be replaced
(e.g., for {n, m} you would need to use {n; m}). See also
how to change the list separator in Windows 10. - {n,n} — Minimum and maximum number of occurrences.
For example, 10{2,3} finds 100 and 1000, but not 10.
- () — Expression: lets you «nest» search expressions within a search term.
For example, <(pre)*(ed)> finds presorted and prevented,
but not repressed and precedent.
See also this tip in French:
Utilisation de caractères génériques pour rechercher.
In addition to simply searching for a specified word or phrase, you can use Word’s advanced search features to search using wildcards or search for special characters.
Search with Wildcards
A “wildcard” is a character (or a short string of characters) that represents multiple characters in a search.
- Click the Find list arrow.
- Select Advanced Find.
- Click the More button.
- Click the Use wildcards check box.
If you’re familiar with wildcards, you can type them out as part of the search phrase. You can also insert them from a menu.
- (Optional) Click the Special menu to select a wildcard.
The wildcard syntax is shown at the top of the list. The syntax can get tricky, and wildcards can be tough to understand without examples. The table on the next page should help explain some common examples.
- Enter a search phrase in the Find what text field.
- Click Find Next.
The search is conducted. Make sure to be careful if you’re using wildcard searches to find and replace text. Keep an eye on the results in case something unexpected is found.
Some common wildcards are shown in the following table.
Wildcard | Purpose | Example |
---|---|---|
? | Any single character | h?t will find hat, hot, and h t |
* | Any number of characters | a*d will find ad, ahead, and as compared |
[ ] | One of these characters | t[ai]n will find tan and tin, but not ton |
[ — ] | One of these characters in a range | [b-d]ot will find bot, cot, and dot |
[! ] | Not the specific characters | [!d]ust will find rust and must, but not dust |
< | The beginning of a word | <(some) will find something, someone, and somewhere |
> | The end of a word | (one)> will find stone, cone, and provolone |
@ | One or more instances of a character | cor@al will find coral and corral |
{n} | Exactly n instances of a character | ^p{2} will find two consecutive paragraph breaks |
{n,} | At least n instances of a character | 10{2,} will find 100, 1000, and 10000 |
{n,m} | Between n and m instances of a character | 10{2,3} will find only 100 and 1000, not 10000 |
Search for Special Characters
You can also specifically search for special characters, such as line and page breaks, paragraph marks, fields, graphics, and dashes.
- Click the Find list arrow.
- Select Advanced Find.
- Click the More button to expand the dialog box, if necessary.
If you’ve expanded the Find and Replace dialog box in a recent search, without collapsing it back down, it will open in an expanded state.
- Click in the Find what text field.
- Click the Special button.
The Special menu lists the special formatting characters that can be searched for.
- Select a special character.
When you select a special character from the menu, the text code for that special character is inserted.
- Click the Find Next button.
The next instance of the selected special character is found.
You can find and replace one special character with another (to replace section breaks with page breaks, for example) on the Replace tab of the Find and Replace dialog box.
FREE Quick Reference
Click to Download
Free to distribute with our compliments; we hope you will consider our paid training.
“Wildcards,” in the context of Microsoft Word, are characters that allow you to refine a search within a document. But how can you use them? And which symbols can you use? In this article, we run through the basics of wildcards in Microsoft Word and how you can use them to search for specific information in a document.
Using Wildcards in Microsoft Word
The process for enabling wildcards in Word is straightforward:
- Press Ctrl+H to bring up the Find and Replace dialogue box.
- Click on More >> and make sure the Use Wildcards box is checked.
Once enabled, you can also use wildcards in Word’s search-only feature (Ctrl+F).
To use wildcards after enabling them, all you have to do is add the relevant symbol to your search term(s). For example, to search for the words “dive” and “dove” at the same time, you would type “d?ve” into the search field since the “?” symbol can stand in for any character. Word will then search for all words that begin with “d” and end in “ve” with a single character in between, including “dive” and “dove.”
Find this useful?
Subscribe to our newsletter and get writing tips from our editors straight to your inbox.
Now, let’s look at some more examples of useful wildcards.
Wildcards to Use in Your Searches
Key wildcards you can use when searching a Word document include:
- ? – You can use a question mark in place of any single character. For example, searching “g?t” will find “got,” “gut,” and “get,” but not “goat” or “gnat.” You can also add multiple question marks to stand in for a set number of unspecified characters (e.g., “g??t” would find both “goat” and “gnat”).
- * – You can use an asterisk in place of any number of characters. For example, “w*t” would find “weight,” “wet,” “what,” and even “when he lost.”
- [ ] – Square brackets will let you search for any one of the specified characters within. For example, “n[oi]t” would find “not” and “nit,” but not “net” or “nut.”
- [ – ] – Adding a hyphen between two characters within square brackets allows you to search for any character within the specified range. For example, “[d-s]ent” would find “dent,” “lent,” and “rent,” but not “bent” or “tent.”
- < – Using a less-than sign allows you to search for words beginning with the stated characters. For example, “<pre” would locate “premeditated,” “prematurely,” and “preview,” but not “impress,” “permission,” or “spree.”
- > – Using a greater-than sign lets you search for words ending with the stated characters. For example, “ing>” would find “walking,” “talking,” and “flying,” but not related words like “walked,” “talks,” or “flew.”
Wildcards can be very useful, especially when it comes to long documents, helping you find specific terms or check spellings for consistency (e.g., looking for “-ise” and “-ize” endings in a document). But the best way to be confident your writing is error free is to have it proofread, so why not contact the professionals today?