Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I want regular expression to validate mobile no in form
91-9876657654
or
9887676545
or
1-6314555173

ie. I can enter country code or I can not but no after country code should be 10 digit.
If not entering code just 10 digit no but not less than 10 digit.
Posted
Updated 18-Oct-10 3:19am
v2
Comments
Sandeep Mewara 18-Oct-10 8:57am    
So? Tried yourself?
Dalek Dave 18-Oct-10 9:19am    
Minor Edit for Readability and Grammar.

Try yourself first. Use free libraries available to do so:
RegEx Tester - Regular Expression Tester[^]
 
Share this answer
 
This will definitely help you.

(\d*-)?\d{10}

Matches to.

91-9876657654
9887676545
1-6314555173

Please Vote and accept answer if it Helped
 
Share this answer
 
Comments
rahul murkute 9-May-14 12:48pm    
thanx....it works...

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