[OpenSIPS-Users] Match regular expression for '+'

Jayesh Nambiar jayesh.voip at gmail.com
Thu Oct 30 10:42:58 CET 2008


Hi Bogdan,Thank you very much.
The expression that matched was:
if(uri=~"^sip:\+[2-9][0-9]*@")

I wanted to match anything starting from +(2-9) followed by any digits and
any number of digits.

Thanks again.

w/regards,
Jayesh

On Thu, Oct 30, 2008 at 1:39 PM, Bogdan-Andrei Iancu <bogdan at voice-system.ro
> wrote:

> Hi Jayesh,
>
> no, it shouldn't, because the whole number (up to @) matches the [2-9]*
> which does not accept 1, but you have 1 in your number.
>
> Regards,
> Bogdan
>
> Jayesh Nambiar wrote:
>
>> Hi Bogdan,
>> Thanks for the reply.
>> So the RE that i had written which is if(uri=~"^sip:\+[2-9]*@")  should
>> match +91981122334455 right?
>> But it does not. Any suggestions?
>>
>> --- Jayesh
>>
>> On Wed, Oct 29, 2008 at 1:12 PM, Bogdan-Andrei Iancu <
>> bogdan at voice-system.ro <mailto:bogdan at voice-system.ro>> wrote:
>>
>>    Hi Jayesh,
>>
>>    try:
>>      if ($ru=~"^sip:\+12127773456 at domain.com
>>    <mailto:12127773456 at domain.com>
>>    <mailto:sip%3A%2B12127773456 at domain.com<sip%253A%252B12127773456 at domain.com>
>>    <mailto:sip%253A%252B12127773456 at domain.com<sip%25253A%25252B12127773456 at domain.com>
>> >>")
>>
>>    + is a special chr in regexp and you need to escape it to use it.
>>
>>    Regards,
>>    Bogdan
>>
>>    Jayesh Nambiar wrote:
>>
>>        Hello,
>>        Can someone please guide me to write a regular expression that
>>        matches URIs like sip:+12127773456 at domain.com<sip%3A%2B12127773456 at domain.com>
>>        <mailto:sip%3A%2B12127773456 at domain.com<sip%253A%252B12127773456 at domain.com>
>> >
>>        <mailto:sip%3A%2B12127773456 at domain.com<sip%253A%252B12127773456 at domain.com>
>>        <mailto:sip%253A%252B12127773456 at domain.com<sip%25253A%25252B12127773456 at domain.com>>>
>> in OpenSIPS.
>>
>>        I want to match numbers starting from '+'.
>>
>>        Any help would be highly appreciated.
>>
>>        Thanks in advance.
>>
>>        w/regards,
>>        Jayesh
>>
>>  ------------------------------------------------------------------------
>>
>>        _______________________________________________
>>        Users mailing list
>>        Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>>        http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20081030/a3f77d47/attachment-0001.htm 


More information about the Users mailing list