[asterisk-dev] zero-or-more match

Jared Smith jsmith at digium.com
Wed Feb 10 12:08:12 CST 2010


On Wed, 2010-02-10 at 11:31 -0600, Russell Bryant wrote:
> Real regex support in the dialplan would be quite awesome, in my 
> opinion.  However, I think it would have to be something that doesn't 
> conflict with existing "exten =>" behavior.  We could call it ... 
> "rexten =>" or something.

I've been asking for this for at least six or seven years now, and even
proposed that we have "regexten=>" to differentiate between Asterisk
pattern-matching language and regular expressions pattern-matching.  The
answer I've always received (for better for for worse) has been "It'll
have too much of an impact on dialplan performance".

We'd obviously need to set priority of one type of pattern matching over
the other, so that people have some sort of expectation how to structure
their extensions.  It's already hard enough for most people to know
which of the following would match if the user dialed extension 822 in
the context below...  Let's make sure we set clear rules for precedence,
or we'll only make matters worse.  

[patterns]
exten => _NXX      ,1,NoOp(1)
exten => _[1-8]22  ,1,NoOp(2)
exten => _[a-h]1X  ,1,NoOp(3)
exten => _X.       ,1,NoOp(4)
exten => _X2.      ,1,NoOp(5)
exten => _[0-9*#]11,1,NoOp(6)

-- 
Jared Smith
Digium, Inc.




More information about the asterisk-dev mailing list