Click here to Skip to main content
14,449,077 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm looking for a simple regex that will validate a 12 digit phone number. I want to put format like xxx-xxx-xxxx. Can someone help out?
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 2

Really awesome tool, google is. Use it sometime, you should. Yes, hmmm.

phone number regex[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

I'm sure you can find something here[^] or at least get an idea
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

var phoneReg = /([0-9]{3})[-. ]([0-9]{3})[-. ]([0-9]{4})/;
   

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