[Asterisk-Users] Regular expression matching for ":" - examples needed

Martin Pycko martinp at digium.com
Fri Sep 5 07:32:35 MST 2003


> Examples I'd like to see:
>
> 1)
>   ${FOO} contains 12345#
>   ${HASH} contains #

something like this:

exten => 123,1,Gotoif($[${FOO} : 12345#]?2|102)

>
>   If ${FOO} contains the contents of ${HASH} anywhere, go to 2. If not, goto 102
>
> exten=> 123,1,GotoIf($[...???...]?2|102)
>
>
> 1.1)
>    If the last digit of ${FOO} is ${HASH}, then goto 2.  If not, goto 102.
>
>
> exten => 123,1,GotoIf($[...???...]?2|102)

exten => 123,1,GotoIf($[${FOO:-1:1} = ${HASH}]?2|102)
assuming ${HASH} is one digit ...


Martin




More information about the asterisk-users mailing list