/^/
EasyValidation

Phone Number Format Check

Write a regex that validates US-style phone numbers written strictly as three digits, a dash, three digits, a dash, then four digits (e.g. 123-456-7890).

//
123-456-7890 / 555-123-4567 / 12-456-7890 / 123.456.7890 / 1234567890

Test cases

  • 123-456-7890expect match
  • 555-123-4567expect match
  • 12-456-7890expect no match
  • 123.456.7890expect no match
  • 1234567890expect no match
  • 123-45-7890expect no match