The following examples illustrate the matching of patterns containing a range of characters. The pattern representation of a range consists of two characters separated by a hyphen and enclosed in brackets. For example, [1-5] indicates a range from '1' through '5'. The presence of any one of the characters in the range results in a match.
Pattern | Searched String | Result |
---|---|---|
CUST[1-5]FIL | CUST1FIL | Match |
CUST[1-5]FIL | CUST4FIL | Match |
CUST[1-5]FIL | CUST6FIL | No match |
CUST1FL[A-Z] | CUST1FLB | Match |
CUST1FL[A-Z] | CUST1FL2 | No match |
CUST1FL[A-Z] | CUST1FLw | No match |
CUST1FL[a-z] | CUST1FL4 | No match |
CUST1FL[a-d0-9] | CUST1FL4 | Match |
CUST1FL[A-D0-9] | CUST1FLL | No match |
cust1fl[A-D0-9] | CUST1FLa | No match |