[Asterisk-Users] Expression in Extension

Peter Svensson psvasterisk at psv.nu
Thu May 19 12:00:05 MST 2005


On Thu, 19 May 2005, Matthew Boehm wrote:

> Hugh L. Johnson wrote:
> > Does ^ work as a NOT in an expression for extensions?
> > Are the following equivalent?
> >
> > exten => _58[^389],1,dial(${${EXTEN}},${RINGLONG},tr)
> >
> > exten => _58[0124567],1,dial(${${EXTEN}},${RINGLONG},tr)
> 
> Not sure which RegEx book you read but ^ (caret) stands for "line beginning"
> not "don't match".

Not inside a square bracket it doesn't. There a caret normally means 
"invert the set" if it is in the first position. See e.g. "man grep" or 
just about any other text describing standard regexps.

>From reading pbx.c (EXTENSION_MATCH_CORE) it seems that asterisk does not 
implement the inverted set inside []. That is ok, I guess, since the 
regexps in Asterisk are among the most nonstandard ones anyone has ever 
seen. :-)

Peter




More information about the asterisk-users mailing list