Searching with Wildcards in Word

By Jack Lyon, the Editorium

Are you getting the most you can from Microsoft Word? Wildcard search is one of the most powerful features in Word. You can use it to quickly find errors and make changes throughout a document in a matter of seconds. In this article, you'll learn how to use “@” and “?” in your word wildcard searches.

Using “@” and “?” in Wildcard Searches

What if you wanted to search a document to find every three-letter combination starting with b and ending with t—“bet,” “but,” “bit,” ”bat,” and so on? You can do that with a wildcard!

Search this wildcard:

b?t

Now let’s say we wanted to find the same characters but add others as well. For example, we might want to find every three-letter combination starting with b and ending with d—“bed,” “bud,” “bid,” “bad,” and so on—in addition to the combinations ending in t. Can we really do that? Sure! We’ll start by entering the letter into the “Find what” box, telling Microsoft Word to find that letter.

Next, we’ll enter the ? wildcard, which tells Microsoft Word to find any single character.

Finally, we’ll enter a new wildcard:

[td]

Microsoft Word will find any one of the characters specified in the brackets (in this case, either or d). Characters specified in this way are called a “range.”

Altogether, the string of characters looks like this:

b?[td]

That particular combination tells Microsoft Word to find the letter followed by any other single character followed by or d.

How can something like this help you? Suppose you’re editing a manuscript in which the author has misspelled a name in nearly every way possible. You could comb through the manuscript over and over, hoping to catch all the variations. Or, you could be sure to catch them all by searching with wildcards. For example, let’s say your manuscript is a book about India and the name in question is Gandhi. Your author has misspelled it as “Ghandi,” “Gahndi,” and “Ganhdi.” (Not possible? Hah!) You can find every last one of them with the following string:

G[andh][andh][andh][andh]i

Then, if you’ve put the correct spelling, “Gandhi,” in the “Replace with” box, you can find and replace each wrong spelling with the right one in a single pass, which is much more efficient than finding and replacing each variation separately.

You may be wondering why you couldn’t just use the * wildcard to represent the whole string of letters, like this:

G*i

You could. But the * wildcard represents any string of characters—including spaces and carriage returns. It’s not limited to characters within a word (and neither are other wildcards). That means, in addition to finding the misspelled names, it will find the first 14 characters of the following phrase: “Go to the officer’s hall.” So be careful, especially if you’re planning to use “Replace All” rather than finding and replacing one item at a time.

There is a way to simplify the wildcard combination, however.

Consider this string:

G[andh]{4}i

It’s functionally the same as this:

G[andh][andh][andh][andh]i.

The {4} tells Word to find exactly four occurrences of the previous “expression,” which is [andh].

But now a complication: Suppose that our slapdash author has also spelled Gandhi’s name as “Gandi.” Uh-oh. Our original string won’t catch that, because this new misspelling is one character shorter than our string specifies. But consider this:

G[andh]{3,4}i

The {3,4} tells Word to find from 3 to 4 occurrences of the previous expression, so this string will catch all of our misspelled variations so far.

What if we want to allow for more or fewer characters, being particularly unsure of our author? We can use this string:

G[andh]@i

The @ wildcard tells Microsoft Word to find one or more occurrences of the previous expression (if there are any) until it reaches an i. That ought to cover nearly anything our author throws at us. If we want to get a little more specific, we can use {3,}, which tells Word to look for at least three occurrences of the previous expression.

Here’s a tip: What would happen if we put a lowercase g rather than a capital G at the beginning of our string? Word wouldn’t find the misspelled names. Why? Because with “Use wildcards” turned on, Word automatically matches case—a useful thing to know.

Continue Your Wildcard Education: Free Download!

Ready to learn even more about Word wildcards?

Download theWildcard Cookbook by Jack Lyon today!

In the Wildcard Cookbook for Microsoft Word, you’ll learn how to build your own wildcard searches with detailed screenshots and instructions. You will gain the confidence you need to implement these time-saving strategies in your work. And if you love the idea of wildcards but are not ready to write your own, the Wildcard Cookbook includes real-world examples that you can simply copy and paste!

This ebook, a $10 value, is available free. Get it while you can. Download your copy now!

Enter your email (optional) to be added to our newsletter. We send one email per month that includes editing tips and discounts. You can unsubscribe at any time.

Check Your Text Faster with PerfectIt