Phone number (US) regex
Accepts US-style phone numbers in several common formats: `(555) 123-4567`, `555-123-4567`, `555.123.4567`, `555 123 4567`, `5551234567`. Optional parentheses around the area code; optional hyphen, period, or space between groups.
Caveats
US-only. International numbers require E.164 format validation, which is a different problem. For multi-country form input, use `libphonenumber-js` instead of a regex — Google's library is the canonical source of truth for phone-number parsing.
Test strings
A mix of values that should match and values that shouldn't — paste these into the tester to see them light up live.
- (555) 123-4567
- 555-123-4567
- 555.123.4567
- 555 123 4567
- 5551234567
- +44 20 7946 0958
- 555-1234