Skip to content

Instantly share code, notes, and snippets.

@brendanmanning
Created January 10, 2019 00:34
Show Gist options
  • Save brendanmanning/bf7cec31259176178a65ecf892529fe1 to your computer and use it in GitHub Desktop.
Save brendanmanning/bf7cec31259176178a65ecf892529fe1 to your computer and use it in GitHub Desktop.
Regex to match a 10 digit phone number, excluding 555 ("movie") numbers
(((?!(555))[0-9]{3})-){2}(((?!(5555))[0-9]{4}))
123-456-7890 Y
555-123-4567 N
123-555-4567 N
123-456-5555 N
550-550-5550 N
555-555-5555 N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment