Copyright 2010-2015 Obihai Technology, Inc.
159
that explicitly matches digits at the start of the number followed by any sequence of digits of a
defined, fixed length. When dialing a number in the Dalton, Georgia area code of 706 from within
North America, we would dial 1 706 then the following 7 digits of the number, as such we would write
our matching rule as follows:
1 706 xxx xxxx
.
. Matching Function
The “full stop” or “dot” - . - matching function matches 0 or more x, X or
@
It’s typically used to capture a string of entered numbers or characters
of arbitrary length.
Example:
The expression xx. would catch any number that is entered with 1 or more digits. Although we have
used two x’s in our rule, the dot implies 0 or more x, so in the event of 0*x the rule xx. caters for a
single digit number being entered. Let’s say we want to match any international numbers dialed to
New Zealand (country code 64) but don’t want to define all the possibilities of the NZ number plan
within our digit map; in this case we can write one of the following rules:
011 64 xx.
Using US international dialing notation
0011 64 xx.
Using Australian international dialing notation
00 64 xx.
Using Standardized international dialing notation
[ ]
Set
“Square brackets” – [ ] – enclose a set of numerals and/or characters
that are used to match a single digit or character.
It’s useful to use a set to match specific digits that form part of a
number. Alphanumeric and wildcard characters are allowed inside a set,
such as [x], [X#], [@#], [a-zA-Zx]
Example:
Let’s look at specifically matching the numbers 1,2,5,6,7 and 8. We can write this set as [125-8] where
we have specified the digits 1 and 2, then written the numbers 5,6,7,8 as the sequence 5-8. To put
this into context, let’s look at the London number range where each number can take the form of 020
3xxx xxxx, 020 7xxx xxxx or 020 8xxx xxxx – while we could write each of these as individual rules, it is
tidier to represent them as follows:
020 [378]xxx xxxx