Wildcards are the power tools of Word for both searching and macros. They limit your queries so that Word does exactly what you want—nothing more, nothing less.
Understanding how to use wildcards can also help you unleash the power of PerfectIt, a proofreading tool that catches small inconsistencies in a document and flags them for review.
This is a quick guide to wildcards and how to use them. To start making expressions, I recommend you check out The Word MVP Site and/or book a one-on-one with me to get hands-on help in crafting queries.
| The Basics: Letters & Numbers |
| [A-z] | any letter |
| [A-Z] | any capital letter |
| [a-z] | any lowercase letter |
| [0-9] | any number |
| [0-9A-z] | any letter or number |
| ? | a single character |
| @ | one or more occurrences of the previous character |
| * | any number of characters (avoid at all costs) |
| Limiting Your Search Terms |
| <> | Ensures whatever you’re searching for is a whole word. You can also use it to set off the beginning or ends of words Examples <set> will find “set” but not “setting” or “reset” <set will find “setting” and “set” but not “reset” set> will find “reset” and “set” but not “setting” |
| [] | Finds the characters/numbers in the bracket Tip: Enclose the word you’re looking for in < > so you don’t get a lot of false positives Examples <[Ff]ind> will find “find” and “Find” <[0-9][0-9][0-9][0]> will find any four-digit number that ends in 0 |
| [!] | Looks for any character but the one in the brackets Tip: Enclose the word you’re looking for in < > so you don’t get a lot of false positives Examples <[!s]et> will find “bet” and “get” (and so on) but never “set” <[!9]0> will find “80” and “70” (and so on) but never “90” <[!go][A-z]@ing> will find “doing” and “singing” (and so on) but never “going” |
| Replacing Text |
| () | Sets off text to be copied into the replacement text Example FIND: <is> <(*)ing> REPLACE: \1 looks for all phrases that have “is ___ing” and replaces the whole phrase with whatever is in parenthesis. So “is singing” will be replaced with “sing” Example FIND: <([0-9])([0-9][0-9][0-9])> REPLACE: \1,\2 Looks for all four-digit numbers and adds a comma after the first digit |