Created
December 5, 2012 08:30
-
-
Save kevinsearle/4213819 to your computer and use it in GitHub Desktop.
PCRE Phone numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This regex will validate a 10-digit North American telephone number. | |
// Separators are not required, but can include spaces, hyphens, or periods. | |
// Parentheses around the area code are also optional. | |
'/^((([0-9]{1})*[- .(]*([0-9]{3})[- .)]*[0-9]{3}[- .]*[0-9]{4})+)*$/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment