Function REGEX

Home » Asterisk Users » Function REGEX
Asterisk Users 2 Comments

Hi

I need help to use the function REGEX. My question is if is possible test a expression as [X123 == 5123] ( If an extension corresponding to a previously defined regular expression). I saw various examples about this function, but nothing as the my needs. I do not understanding exactly how to works this function.

Thank’s

Att,
*Rafael dos Santos Saraiva*

2 thoughts on - Function REGEX

  • Here is an example from one of my production dialplans

    same => n,ExecIf(${REGEX(“^1205|^1256|^1850|^1718|^1212|^1917|^1347|^1646|^1929” ${CALLERID(num)})}]?Hangup)

    Assuming you meant 0-9 and not the literal X (which means nothing special in regular expressions):

    same => n,ExecIf(${REGEX(“^[0-9]5123$” ${EXTEN})}]?Hangup)

    —–Original Message—