Copyright 2010-2017 Obihai Technology, Inc.
221
The following advanced elements allow you to further compact your rules for more elegant digit map syntax:
X
X Wildcard
The “uppercase x” –
X
–
wildcard matches any digit from 0-9 as well as *
making it useful for use digit maps that include star codes. It is
important to note that X is CASE SENSITIVE.
Usage Notes:
X is equivalent to [x*] or [0-9*x]
Example:
If we wish to catch all three digit numbers including star codes, we could write our matching rule as
follows:
XXX
@
@ Wildcard
The “at symbol”
- @ - wildcard matches any alphanumeric character
except #
Example:
To match any arbitrarily long alphanumeric sequence (except #) that does not start with * we would
write our matching rule as follows:
[^*]@@.
?
? Matching Function
The “question mark”
- ? - matching function matches 0 or 1 x, X or @
This function can be used to capture a string of entered numbers or
characters of multiple known fixed lengths
Example:
The expression xxxx? would catch any number that is entered that is either 3 or 4 digits in length.
Let’s say we live in an area where local numbers vary in length. In
this example we will use the
Brampton area in the UK that has 4 and 5 digit local numbers. Rather than using two rules in our digit
map such as (…|xxxx|xxxxx|…) to match the local numbers, we can write a more elegant matching
rule as follows:
xxxxx?