[asterisk-users] REGEX Function

Yuan LIU yliu11 at hotmail.com
Mon Feb 12 23:34:32 MST 2007


>From: Doug Garstang <dgarstan at talkplus.com>
>Date: Mon, 12 Feb 2007 18:21:38 -0800
>
>What's wrong with this?
>
>exten => s,n,Set(CIDNUM=16505551212)
>exten => s,n,Set(foo=${REGEX("^[0-9]+$" CIDNUM)})
>
>This always returns 0, false. That isn't correct.
>
>I also tried:
>
>exten => s,n,Set(dollar=$)
>exten => s,n,Set(foo=${REGEX("^[0-9]+${dollar}" CIDNUM)})

You are trying to match "^[0-9]+$" with the string CIDNUM.  Of course that's 
a mismatch.  Try referencing the _value_ of the variable, ${CIDNUM}.

Yuan Liu

>and that didn't work either. I am trying to use a regex to see if the 
>caller id contains numbers only.
>
>Doug.
>
>_______________________________________________
>--Bandwidth and Colocation provided by Easynews.com --
>
>asterisk-users mailing list
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list