[OpenSIPS-Users] Regular expression matching problem in OpenSIPS

Pauba, Kevin L KLPauba at west.com
Wed Sep 3 16:11:01 CEST 2008

You ask a very good question, Jayesh.


If I might add ...


Can someone tell me if there's a difference between the re language for
the "=~" operator and other functions from the textops module like
subst(), subst_user(), et.al.?


I was recently bit by a change in behavior when moving from SER to
OpenSER.  In SER, subst_user(/^/99900/) would add the prefix to the user
part of the R-URI.  The same expression in OpenSER yielded a regular
expression error (something to the effect that the re matched null).  I
had to change this to read subst_user(/^(.*)$/99900\1/) in OpenSER to
get it to work as expected.


An explicit reference in the documents to the re syntax would be helpful
- especially important is any documented differences in the matching
operator "=~" and the functions in other modules like textops.





From: users-bounces at lists.opensips.org
[mailto:users-bounces at lists.opensips.org] On Behalf Of Jayesh Nambiar
Sent: Wednesday, September 03, 2008 7:03 AM
To: users at lists.opensips.org
Subject: [OpenSIPS-Users] Regular expression matching problem in


I am using a regular expression to match patterns like +12127773456.
The one I am using is: if(uri=~"sip:\+[1-9]+ at .*$").

The above condition was working until I used Openser 1.3.2 but when I
upgraded to Opensips this does not seem to work.

Can someone please suggest something on what regular expression should I
be using.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20080903/907e475b/attachment-0001.htm 

More information about the Users mailing list