RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Mobile Number Validation
Expression
^((\+)?(\d{2}[-]))?(\d{10}){1}?$
Description
Indian mobile no. with country code as optional example:-- function validate() { var filter1=/^((\+)?(\d{2}[-]))?(\d{10}){1}?$/,filter2=/^((\+)?(\d{2}[-])(\d{2}[-]))?(\d{8}){1}?$/; var mobileNo=$("#mobileNo").val(),temp=0; if (filter1.test(mobileNo)) { //temp++; } if (filter2.test(mobileNo)) { temp++; } if (temp>0) { alert("Matched with given format!"); } else { alert("Not Matched with given format!"); } here mobileNo is an input filed in my html page.. you can use it as per your need..
Matches
+91-9822345654,9822345654,+91-80-25746669
Non-Matches
+923-9855777897,6463466
Author Rating: The rating for this expression. Deepak Goswami
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials