Click here to Skip to main content
15,883,954 members
Please Sign up or sign in to vote.
1.60/5 (2 votes)
Hi Friends,
I have a form need to do validation for Mobile numbers, the problem is the form can be filled by world wide, so the problem is ex. for India:10 digits and 2 digits country code and for Singapore 8 digits number and 2 digits country code.
So that i want to keep minimum 8 digits and maximum 10 digits of validation.
Posted
Updated 18-Jul-17 20:47pm

 
Share this answer
 
^([0|\+[0-9]{1,5})?([7-9][0-9]{9})$

This will accept first digit as either 0 or + digits (0-9) and (1-5) as first and second digit respectively, followed by mobile no. which starts from 7,8 or 9 and rest 9 digits from 0 to 9
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900