Hi Bogdan,<div>Thank you very much.</div><div>The expression that matched was: </div><div>if(uri=~"^sip:\+[2-9][0-9]*@") </div><div><br></div><div>I wanted to match anything starting from +(2-9) followed by any digits and any number of digits.</div>
<div><br></div><div>Thanks again.</div><div><br></div><div>w/regards,</div><div>Jayesh<br><br><div class="gmail_quote">On Thu, Oct 30, 2008 at 1:39 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Jayesh,<br>
<br>
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.<div class="Ih2E3d"><br>
<br>
Regards,<br>
Bogdan<br>
<br>
Jayesh Nambiar wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="Ih2E3d">
Hi Bogdan,<br>
Thanks for the reply.<br>
So the RE that i had written which is if(uri=~"^sip:\+[2-9]*@") should match +91981122334455 right?<br>
But it does not. Any suggestions?<br>
<br>
--- Jayesh<br>
<br></div><div class="Ih2E3d">
On Wed, Oct 29, 2008 at 1:12 PM, Bogdan-Andrei Iancu <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>> wrote:<br>
<br>
Hi Jayesh,<br>
<br>
try:<br>
if ($ru=~"^sip:\+<a href="mailto:12127773456@domain.com" target="_blank">12127773456@domain.com</a><br></div>
<mailto:<a href="mailto:12127773456@domain.com" target="_blank">12127773456@domain.com</a>><div class="Ih2E3d"><br>
<mailto:<a href="mailto:sip%253A%252B12127773456@domain.com" target="_blank">sip%3A%2B12127773456@domain.com</a><br></div>
<mailto:<a href="mailto:sip%25253A%25252B12127773456@domain.com" target="_blank">sip%253A%252B12127773456@domain.com</a>>>")<div class="Ih2E3d"><br>
<br>
+ is a special chr in regexp and you need to escape it to use it.<br>
<br>
Regards,<br>
Bogdan<br>
<br>
Jayesh Nambiar wrote:<br>
<br>
Hello,<br>
Can someone please guide me to write a regular expression that<br>
matches URIs like <a href="mailto:sip%3A%2B12127773456@domain.com" target="_blank">sip:+12127773456@domain.com</a><br>
<mailto:<a href="mailto:sip%253A%252B12127773456@domain.com" target="_blank">sip%3A%2B12127773456@domain.com</a>><br>
<mailto:<a href="mailto:sip%253A%252B12127773456@domain.com" target="_blank">sip%3A%2B12127773456@domain.com</a><br></div>
<mailto:<a href="mailto:sip%25253A%25252B12127773456@domain.com" target="_blank">sip%253A%252B12127773456@domain.com</a>>> in OpenSIPS.<div class="Ih2E3d"><br>
<br>
I want to match numbers starting from '+'.<br>
<br>
Any help would be highly appreciated.<br>
<br>
Thanks in advance.<br>
<br>
w/regards,<br>
Jayesh<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br></div>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>><div class="Ih2E3d"><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br></div>