Click here to Skip to main content
14,920,374 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,i am figuring how to use a regular expression to validate phonenumber in this format below

345712332111.It should start with area code i.e 345
Any one who can help sort this?
Thanks
Posted
Updated 19-Mar-20 20:33pm

try this
C#
\(?\d{3}\)?-? *\d{3}-? *-?\d{6}

if you try this code, working like this type 345-712-332111. you can change number as you according or you hit this link http://stackoverflow.com/questions/18091324/regex-to-match-all-us-phone-number-formats[^]
   
v2

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