.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

validation for phone numbers

Posted By:Gowthammanju       Posted Date: June 30, 2011    Points: 40    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

this code explain about perfroming the validation for mobile numbers
 

here it is


To accept Indian (Landline) phone numbers: /^[0-9]\d{2,4}-\d{6,8}$/

This is indian phone number. where it will take a format of std code 3 to 4 digits, hypen and rest of the 6 to 8 digits.


Ex: 044-xxxxxxx 


This one is for eight digit no :: \d{8} eg: 11111111


This one is for mobile no:: \d{10} eg: 9998945678

This one is for mobile no with india code \d{13} eg 91 09894xxxxxx

This one is for Mobile no with india code then space and then mobile no 

whith zero as starting :: +\d{2}\s\d{9}

eg:+91 09894xxxxxx


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend