There are five pattern matching operations other than a strict one-to-one match between the pattern and the source to be checked for a match. • Asterisk (
*) to match any sequence of zero or more characters. • Question mark (
?) to match any single character. •
Set of specified characters. It is specified as a list of characters, or as a range of characters where the beginning and end of the range are separated by a minus (or dash) character, or as any combination of lists and ranges. The dash can also be included in the set as a character if it is the beginning or end of the set. This set is enclosed in square brackets. The close square bracket (]) may be used in a set if it is the first character in the set. •
Negation of a set. It is specified the same way as the set with the addition of a caret character (^) at the beginning of the test string just inside the open square bracket. (NNTP specifies an alternative !. The implementation can be configured to do either.) • Backslash (
\) character to invalidate the special meaning of the open square bracket ([), the asterisk, backslash or the question mark. Two backslashes in sequence will result in the evaluation of the backslash as a character with no special meaning.
Examples •
*foo* matches string containing "foo". •
mini* matches anything that begins with "mini" (including the string "mini" itself). •
???* matches any string of three and more letters. •
[0-9a-zA-Z] matches every single
alphanumeric ASCII character. •
[^]-] matches a character other than a close square bracket or a dash. ==Usage==