[Asterisk-Users] regexp

Noah Miller noahisaacmiller at gmail.com
Tue May 16 12:15:00 MST 2006


Hi Domenico -

> I'm trying to match a few of numbers in a GotoIf; numbers are not starting
> with but contain some strings:
>  GotoIf($["${CALLERIDNUM}" =~ "984836|984899|498993|644110"]?8:11)
> Expression result is always '0'.

First, you can remove the quotes aorund your variable reference.  I've
seen examples with it, but you don't need it.  Second, I'm not sure
what the tilde does after the equal sign, but asterisk won't
understand it.  Third, I think you need to put the actual numbers in
another set of brackets rather than quotes, then enclose this in
parentheses.  Try this:

GotoIf($[$CALLERIDNUM} = ([984836|984899|498993|644110])]?8:11)

- Noah



More information about the asterisk-users mailing list