Just a thought. How about the following idea:
1. Before compiling the regex, change it the following way: prefix ->
^(prefix).*$
2. Match the called number to all the provisioned prefixes.
3. The "best" match amongst the matched regexes is the one where the
length of the substring matched to the first subpattern (part of the
regex in the parentheses) is the longest.
The drawback of this approach is that it is necessary to always try to
match against all the prefixes, so, if it is necessary to support many
prefixes then it is not a good idea.
Anatoly.
Hi Juha,
I know that you were referring to Alan's setup. I was just pointing
out that regex has this issue in general.
Let's consider the following example: a call to a 1800 number.
The destination is 18001231234 and in the lcr table we have the
following two prefixes:
1. ^18[01234567]
2. ^18[0-2]01
The second prefix is a better match for the 1800 number, but it has a
shorter length.
-ovi
On 6/8/07, Juha Heinanen <jh(a)tutpro.com> wrote:
Ovidiu Sas writes:
This would be an issue for prefix regex matching.
i was referring to alan's current setup.
How we determine the best match, since checking
the prefix length
doesn't make sense anymore?
it would still need to be on the longest match of any regexp and may get
tricky.
-- juha
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users