[asterisk-users] Matching *, + and # in the dialplan

Karl Fife asterisk-users at kfife.mailworks.org
Tue Oct 14 19:59:13 CDT 2008


On Wed, 15 Oct 2008 01:54:40 +0200, "Benny Amorsen"
<benny+usenet at amorsen.dk> said:
> "Karl Fife" <asterisk-users at kfife.mailworks.org> writes:
> 
> > is in fact simply something like:
> >
> > exten => _[0-9*#+]X.,1,NoOp(*** match ***)
> 
> As long as you're happy to match *9foo and not match **123, then yes,
> that will work.

Thanks Benny.

Please correct me if I'm wrong but I think that _[0-9*#+]X. would match
*9foo but not **123 because of the 'X 'after the '[0-9*#+]' 

however you bring up a good point, which is that . means one or more of
ANYTHING including alpha etc (and not one or more of the preceding
character or expression as would '*' in a regex).  

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)

Thanks!
-Karl



More information about the asterisk-users mailing list