Click here to Skip to main content
14,983,808 members
Please Sign up or sign in to vote.
2.00/5 (1 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

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

phone number regex[^]
   
I'm sure you can find something here[^] or at least get an idea
   
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900