Wildcards
The wildcard characters that you can use in search terms and the ways in which you can use them differ depending on the active search facility.
Wildcards with the metadata query engine
While the metadata query engine is active, you can use two wildcard characters:
- The question mark (?), which represents a single character
- The asterisk (*), which represents any number of consecutive printable characters, including none
With the metadata query engine, wildcard characters are valid at the end of a search term or within a search term. Wildcards are not valid at the beginning of a search term. That is, you cannot search for values that end with the text you specify. For example, the search terms in the first line below are valid; the one in the second line is not.
Valid: 201? Valid: S*day Invalid: *day
You can use multiple wildcards in a search term. Two asterisks next to each other are treated as a single asterisk. Asterisks with characters between them are treated as separate wildcards. For example, the search term below matches the path /Conflicts.txt:
c**nflict*
Similarly, in an all
query, the search term below matches any path with at least two directories preceding the object in the path:
/*/*/**
Two question marks next to each other are treated as separate wild cards. For example, the search term below does not match the path /Conflicts.txt:
c??nflict*
The question mark and asterisk characters do not function as wildcards when specified within double quotation marks (") or in an exact
query.
Wildcards between text that the metadata query engine considers to be separate search terms are not valid. For example, the search string below does not match the path test1.txt because the wildcard is between an alphabetic character and a numeric character:
tes*1
Wildcards with the Data Discovery Suite search facility
While the Data Discovery Suite search facility is active, you can use the asterisk (*) as a wildcard character in a search term to represent any number of consecutive printable characters, including none. With the Data Discovery Suite search facility, the wildcard character is valid only at the end of a term. That is, you can search only for words that begin with the text you specify. For example, the search term on the first line below is valid; the terms on the second line are not.
Valid: 201* Invalid: S*day Invalid: *day
You can use the wildcard character at the end of any or all of the terms in an any
or all
search. For an exact
search, you can use a wildcard only if the term doesn’t include any embedded spaces. For example, the term below on the left is valid for an exact
search; the one on the right is not.
Valid: principal* Invalid: principal exec*
You cannot use wildcards anywhere in quoted terms. Also, you cannot use a wildcard with a text string that has an underscore (_) anywhere in it.