Regex for US Phone Number
Matches US phone numbers in common formats: (555) 123-4567, 555-123-4567, 5551234567, 555.123.4567.
Pattern
/^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$/Pattern Breakdown
| Token | Explanation |
|---|---|
| ^ | Start of string |
| \(? | Optional opening parenthesis |
| \d{3} | Three-digit area code |
| \)? | Optional closing parenthesis |
| [-.\s]? | Optional separator (dash, dot, or space) |
| \d{3} | Three-digit exchange code |
| [-.\s]? | Optional separator |
| \d{4} | Four-digit subscriber number |
| $ | End of string |
Test Examples
| Input | Match? |
|---|---|
| (555) 123-4567 | Match |
| 555-123-4567 | Match |
| 5551234567 | Match |
| 555.123.4567 | Match |
| 55-1234567 | No match |
| 1-555-123-4567 | No match |
Common Use Cases
- Phone number form validation
- Contact information parsing
- CRM data cleaning
Variations
^1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$With optional country code 1
^\+1\d{10}$E.164 format for US numbers
Other Regex Patterns
Want to test this pattern with your own data?
Open the Regex Tester