Address Translation Rules and Syntax
Ranges
Now suppose the second digit of a address could be either a 0 or a 1. You could use two matching rules:
$0$$$$$
$1$$$$$
Or you could use another type of wild card. The range wild card will match one of several digits. You specify a range wild card by enclosing the list of possible matching digits within square brackets [ ].
For example, [0-9] indicates "match any single digit in the range from 0 to 9." Or, [2468] will match any single digit that is a 2 or 4 or 6 or 8.
For example, the two previous matching rules above might be specified as the single rule:
$[01]$$$$$
Another rule could be created for addresses where the first three digits are always 703. The fourth digit can be 7, 8, or 9 (a range from 7 to 9) and the next two digits are always 0, and the last 4 digits can be anything.
Using the range definition operator, we can build this rule:
I: 703[7-9]00$$$$ =
When you have several consecutive digits being specified as in the above example, you can use the dash (-) to indicate all digits between a low and high digit.
Not Qualifier
Placing a leading tilde (~) immediately before the digits within the range wild card indicates a match on any digit EXCEPT those specified. Thus, another specification for the previous matching rule could be:
I: 703[~0123456]00$$$$
More Examples
[13]?
any 2 digit address that begins with a 1 or 3
+[1-3]
any address that ends with a 1 or 2 or 3
[~6-8]+
any address that does not begin with a 6 or 7 or 8