Created
January 31, 2012 22:40
-
-
Save patrickkettner/1713531 to your computer and use it in GitHub Desktop.
allows for optional parens, dashes, dots, and country code
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
^(?:(?:\+?1\s*(?:[.-]\s*)?)?(\()?(?:(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])(\))?\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment