On 19.02.2020 15:40, Donat Zenichev wrote:
Regular expression is used in a condition:
if ( $rU =~ "^$var(each)" )

$var(each) - is a string variable, not integer. It contains certain prefix, like "44".

For some reason OpenSIPS script is not able to get through this check properly.
But, in case I hardcode something like this:
if ( $rU =~ "^44" )
then it passes a check as needed.

Hi Donat,

Indeed, that is a syntax limitation.  What's interesting, is that if you were to do:

    $var(regex) = "^" + $var(each);
    if ($rU =~ $var(regex))

... you would be surprised to find out that it would actually work!

Regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit, Amsterdam, May 2020
  www.opensips.org/events
OpenSIPS Bootcamp, Miami, March 2020
  www.opensips.org/training


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to