Table of Contents

Wildcard Patterns

For settings that allow wildcards, the following are allowed in the wildcard patterns:

Pattern Description
? any one character
* any sequence of zero or more characters
[ABC] one character from a set
[0-9] one character from a range
[ABC0-9] combination of the above
ALT1|ALT2 alternatives for the entire string
(ALT1|ALT2) alternatives within the overall string
\ treat the next character as a literal

Matches using wildcard patterns are not case-sensitive.

If more complex pattern matching is required, a regular expression pattern can be specified by surrounding the pattern with slashes (/). See Regular Expressions for more information.

Examples

Pattern Description
?XYZ-* A model number that contains "XYZ-" starting at the second position.
*EF A model number that ends with "EF".
?(XYZ|ABC)-* A model number that contains either "XYZ-" or "ABC-" starting at the second position.
?AB[CD]-* Any model number that contains "ABC-" or "ABD-" starting at the second position.
*[0-9][0-9] A model number that ends with two numerical digits.
(1234|2345|3456)* Serial numbers that start with "1234", "2345", or "3456".
1234\*5678 Model number "1234*5678".

Regular Expressions

Regular expressions provide an extremely powerful and flexible way to specify complex patterns. They can be used when simple wildcard patterns are insufficient. To specify a wildcard pattern using a regular expression, surround the expression with slashes (/).

The regular expressions are matched using these options:

  • Matches are not case-sensitive.
  • Dot (.) matches every character (instead of every character except \n).
  • Cultural differences in language is ignored.

Be careful to include ^ and $ (or \A and \Z) in the regular expression to indicate start and end positions, as appropriate.

This table demonstrates the regular expression equivalents for the simple wildcard examples from the "Wildcard Patterns" section:

Simple Wildcard Example Regular Expression Equivalent
?XYZ-* /^.XYZ-/
*EF /EF$/
?(XYZ|ABC)-* /^.(XYZ|ABC)-/
?AB[CD]-* /^.AB[CD]-/
*[0-9][0-9] /\d\d$/
(1234|2345|3456)* /^(1234|2345|3456)/
1234\*5678 /^1234\*5678$/

The following examples demonstrate more complex scenarios that cannot be expressed using simple wildcards:

Pattern Description
/^.(?!XYZ-)/ Any model number that does not contain "XYZ-" starting at the second position.
/^(?!(1234|1235|1236)$).+/ Any serial number except for 1234, 1235, or 1236.
/(?-i)^.XYZ-/ A model number that contains "XYZ-" starting at the second position, case-sensitive (i.e., "AXYZ-123" would match, but "axyz-123" would not).
/^((?!-FR).)*$/ Any model number that does not contain "-FR" anywhere within the number.

For information about the regular expression syntax that is supported, see Regular Expression Language - Quick Reference.