KB11122101 Using WildcardsWildcards are used in many places throughout the system. Essentially, wildcards are used to match a single text item (such as an e-mail address, IP address, header entry, and so on). Basic Wildcard Format Wherever wildcards are supported, there are two basic wildcard characters that can be used. The asterisk (*) represents zero or more characters, while the question mark (?) represents any single character. For example, jsm?th*@host.com would match jsmith@host.com orjsmythe@host.com but not jsmeether@host.com or jsmith@otherhost.com Wildcard Lists In places where you can enter multiple wildcards (usually one per line), the item is tested against each in turn. Wildcards can be prefixed with a tilde (~) which negates the match. For example ~*@host.com jsmith@host.com would fail to match anything ending with @host.com, unless it was jsmith@host.com Wildmat Format If a wildcard is prefixed with =^, wildmat format is used. Wildmat compares the text against the pattern and returns non-zero if the pattern matches the text. The pattern is interpreted according to rules similar to shell filename wildcards, and not as a full regular expression. \x treats x as a literal (usually when x is an * or ? or other special character) * represents zero or more characters ? represents any single character [x..y] represents any single character in the set x..y. A minus sign may be used to indicate a range of characters. That is, [0-5abc] is a shorthand for [012345abc]. More than one range may appear inside a character set; [0-9a-zA-Z._] matches almost all of the legal characters for a host name. The close bracket, ], may be used if it is the first character in the set. The minus sign, -, may be used if it is either the first or last character in the set. [^x...y] matches any character not in the set x...y, which is interpreted as described above. For example, [^]-] matches any character other than a close bracket or minus sign. Regular Expression Format If a wildcard is prefixed with =~, it is considered a regular expression. Regular expressions are quite complex, so for more information refer to an Internet Search Engine. |