[Asterisk-Users] Using REGEX function

Kevin P. Fleming kpfleming at digium.com
Wed May 17 06:36:12 MST 2006


Wes Santee wrote:

> The first problem is obviously that the curly braces used in regex patterns to 
> denote repeating patterns means something different to Asterisk.  I would expect 
> back-slashing to fix this.  So...

This was just recently fixed in SVN branch 1.2, and the fix will be part
of the 1.2.8 release that will appear later this week.

In the meantime, you can work around the problem by storing the regex
string itself in a variable, then using a variable substitution in the
${REGEX()} function call, like this:

exten => ...,1,Set(MATCH="[2-9][0-9]{2}[2-9][0-9]{6}")
exten => ...,n,Set(isnum=${REGEX(${MATCH} ${EXTEN:2})})



More information about the asterisk-users mailing list