Share via


MS-DOS and Windows Wildcard Characters

Note

Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.

 

The asterisk (*) and question mark (?) are used as wildcard characters, as they are in MS-DOS and Windows. The asterisk matches any sequence of characters, whereas the question mark matches any single character. In its long form, Dialect 2 uses the {regex} tag with the asterisk or the question mark to specify the wildcard characters. In its short form, Dialect 2 uses the equal sign (=) to indicate that wildcard characters are used. Essentially, "=" turns on the MS-DOS/Windows wildcard character mode. If no equal sign is used, a CONTAINS operator is assumed.

To Search For Example Results
Documents with any number of characters in the name.
{prop name=filename} {regex} *.doc {/regex}{/prop}
—Or—
#filename = *.doc
Documents with any name and the extension doc.
Documents with any number of characters in the extension.
{prop name=filename} {regex} readme.* {/regex}{/prop}
—Or—
#filename = readme.*
Documents with the name readme and any extension.
Documents with a specified number of characters in the extension.
{prop name=filename} {regex} readme.??? {/regex}{/prop}
—Or—
#filename = readme.???
Documents with the name readme and any three-character extension.

 

Note

In the Indexing Service query language, the syntax #contents = text is invalid.t