Using wildcard special characters

You can use the following wildcard characters to represent variable portions of search strings with the WILDCARD operator.

Table 8-8: Wildcard Special Characters

Character

Function

?

Specifies one of any alphanumeric character, as in ?an, which locates “ran,” “pan,” “can,” and “ban.” It is not necessary to specify the WILDCARD operator when you use the question mark. The question mark is ignored in a set ([ ]) or in an alternative pattern ({ }).

*

Specifies zero or more of any alphanumeric character, as in corp*, which locates “corporate,” “corporation,” “corporal,” and “corpulent.” It is not necessary to specify the WILDCARD operator when you use the asterisk, and you should not use the asterisk to specify the first character of a wildcard string. The asterisk is ignored in a set ([ ]) or in an alternative pattern ({ }).

[ ]

Specifies one of any character in a set, as in <WILDCARD> `c[auo]t`, which locates “cat,” “cut,” and “cot.” Note that you must enclose the word which includes a set in backquotes (`), and there can be no spaces in a set.

{ }

Specifies one of each pattern separated by a comma, as in <WILDCARD> `bank{s,er,ing}`, which locates “banks,” “banker,” and “banking.” Note that you must enclose the word which includes a pattern in backquotes (`), and there can be no spaces in a set.

^

Specifies one of any character not in the set, as in <WILDCARD> `st[^oa]ck`, which excludes “stock” and “stack” but locates “stick” and “stuck.” Note that the caret (^) must be the first character after the left bracket ([) that introduces a set.

-

Specifies a range of characters in a set, as in <WILDCARD> `c[a-r]t`, which locates every three-letter word from “cat” to “crt.”