On Wed, 2008-10-15 at 09:06 -0400, Jared Smith wrote: > On Tue, 2008-10-14 at 19:59 -0500, Karl Fife wrote: > > QUESTION: Is there a way to do just that? As in: match: > > one more of the preceding character or expression (a variation on '.') > > zero more of the preceding character or expression (a variation on bang) > > No, there's currently nothing in the Asterisk pattern matching syntax to > constrain one digit to be related in any fashion to the preceding digit. >
Jared is correct.
What you really want is the RE *, +, and maybe even () features.
Not to mention '?'...
Some RE features would be easy to implement in the trie, but
the real killer is trailing context... for instance...
XX[58]*ZZ
If you give it the pattern 3358, it has to decide that
the [58]* part is empty and the 58 is matched by ZZ.
And this makes the whole algorithm pretty hairy.
The current notation lends itself to a fast left-to-right
evaluation, without multiple recursive attempts to find
a path that would lead to a match.
But, if you are willing to forego trailing context,
and make it so any *,+, {x,z}, or ? is at the end of an expression,
like . is now, this could be implemented fairly straightforwardly in our
current pattern matchers.
See my previous conversations in the dev mailing list, back in aug
2007...
let's see:
http://lists.digium.com/pipermail/asterisk-dev/2007-August/028844.html
http://lists.digium.com/pipermail/asterisk-dev/2007-August/028846.html
http://lists.digium.com/pipermail/asterisk-dev/2007-August/028858.html
murf
--
Steve Murphy
Software Developer
Digium
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
