US Phone Number Validation Regex
Validate US phone numbers in multiple formats including (555) 123-4567, 555-123-4567, and 555.123.4567.
Pattern & Test String
About This Pattern
Pattern: ^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$
Flags: g
Results
Enter a regex pattern to see the results here.
Frequently Asked Questions
What phone number formats does this match?
This pattern matches US phone numbers with or without parentheses around the area code, and with spaces, hyphens, or dots as separators. Examples: (555) 123-4567, 555-123-4567, 555.123.4567, 5551234567.
Does this work for international phone numbers?
No, this pattern is specifically for US 10-digit phone numbers. For international numbers, you'll need a different pattern that handles country codes and varying lengths.
How do I extract just the digits from a matched phone number?
Use the capture groups in this pattern. The three groups capture the area code, exchange, and subscriber number separately, which you can then concatenate.
Practical Examples
Contact Form Validation
Validate phone number input in contact or registration forms.
Phone Number Extraction
Extract phone numbers from documents or customer records.
Data Cleanup
Identify and standardize phone numbers in databases.
Common Issues & Solutions
If you need to support extension numbers (like 555-123-4567 x123), add an optional extension pattern at the end: (\s*x?\d+)?
For stricter validation, consider rejecting invalid area codes (like 000 or 555) using negative lookahead patterns.
This pattern requires exactly 10 digits. For toll-free numbers starting with 1, adjust the pattern or preprocess the input.