Click here to Skip to main content
14,486,704 members
Rate this:
Please Sign up or sign in to 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
Rate this:
Please Sign up or sign in to vote.

Solution 2

try this
\(?\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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100