File-search wildcards can be traced back to the dawn of Microsoft operating systems, well before the Windows era. In Windows 7, two of these venerable operators are alive and well:
• * The asterisk (also known as a star) operator can be placed anywhere in the search string and will match zero, one, or any number of arbitrary characters. In indexed searches, which treat your keyword as a prefix, this operator is always implied at the end; thus, a search for voice will turn up voice, voices, and voice-over. Add an asterisk at the beginning of the search term (*voice) and your search will also turn up any item containing invoice or invoices. You can put an asterisk in the middle of a search term as well, which is useful for searching through folders full of data files that use a standard naming convention . If your invoices all start with INV, followed by an invoice number, followed by the date (INV-0038-20090227, for example), you can produce a quick list of all 2009 invoices by searching for INV*2009* .
• ? The question mark is a more focused wildcard . In index searches, it matches exactly one character in the exact position where it's placed. Using the naming scheme defined in the previous bullet, you could use the search term filename:INV-????-2009* to locate any file in the current location that has a 2009 date stamp and an invoice number (between hyphens) that is exactly four characters long
In both the previous examples, we described the behavior of searches in indexed locations, such as a library or a folder within a library. In other locations, the grep search engine kicks in . By default, anything you enter here is treated as a character search that can match all or any part of a word. Thus, if you open a data folder that is not in a library and enter the search term voice, you'll get back voices and voice-over and invoice. The behavior of wildcards varies slightly as well. In grep search, ??voice matches invoice but not voice. In an indexed search, the wildcards at the beginning of the term are ignored in favor of loose matches. (Extra question marks at the end of a search term are ignored completely.)
To force Windows Search to use strict character matches in an indexed location, type a tilde (~) as the first character in the search box, followed immediately by your term . If you open your Documents library and type ~??v in the search box, you'll find any document whose file name contains any word that has a v in the third position, such as saved and level and, of course, invoice. This technique does not match on file contents .
Was this article helpful?