Regex for a US Phone Number
Matches common US phone number formats with optional parentheses and separators.
Published October 10, 2026
This regex matches common US phone formats: optional +1, optional parentheses around the area code and optional separators.
How the pattern works
Breaking the pattern down: (\+1[\s.-]?)? = optional country code; \(?\d{3}\)? = area code, parentheses optional; [\s.-]? = optional separator; \d{3}[\s.-]?\d{4} = local number.
Test your regex against both matching and non-matching inputs; use the Regex tool on this site to experiment live.
Pattern tests
/^(\+1[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$/
✓ '(555) 123-4567'
✓ '555-123-4567'
✓ '+1 555.123.4567'
✗ '12345'
✗ '555-1234'
Practical examples
The pattern
const re = /^(\+1[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$/Test it
const re = /^(\+1[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$/
re.test('(555) 123-4567') // true
re.test('555-123-4567') // true
re.test('12345') // false
re.test('555-1234') // falseIn Python
import re
re.search(r'^(\+1[\s.-]?)?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$', text)Common mistakes
- Rejecting valid separators.
- Forgetting extensions.
- Storing the formatted string instead of digits only.
Key takeaways
- Anchors (^ and $) make the whole string match instead of a part of it.
- Regex checks format only; verify data separately when it matters.
- Test with valid and invalid samples.
FAQ
Normalise before storing?
Strip non-digits and store E.164 (+15551234567).
Where can I test this pattern?
Use the Regex Tester on this site, or regex101.com.