US Phone Number Regex (10 Digits)
^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$Quick answer
This regex matches standard 10-digit US phone numbers. It allows optional parentheses around the area code, and optional dashes, dots, or spaces as separators.
🛠️ Fix it right here with AI Regex Generator
Need to modify this pattern or generate a new one? Edit the regex below and let our AI help.
Live Regex Tester
Type a string below to see if it matches this pattern.
How it works
It breaks down into 3 groups: \\(?([0-9]{3})\\)? matches the area code with optional parentheses. [-. ]? allows an optional separator (dash, dot, or space). It repeats this for the next 3 digits and the final 4 digits.
Code Examples
✅ Correct Usage
// JavaScript
const usPhoneRegex = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;
console.log(usPhoneRegex.test("(555) 123-4567")); // true
console.log(usPhoneRegex.test("555.123.4567")); // true❌ What NOT to do
// BAD: Only accepts 555-123-4567 format
const badRegex = /^\d{3}-\d{3}-\d{4}$/;Frequently asked questions
Does this handle country codes?
No. This is specifically for 10-digit US/Canada numbers. If you need +1, you must add (\+?1[-. ]?)? to the start.
What about Indian phone numbers?
Indian numbers are 10 digits but start with 6-9. The regex would be ^[6-9]\d{9}$.
Related Search Terms
Related Regex Patterns
Need a custom regex pattern?
Use the free to describe what you need in plain English.
Want an AI with memory for your project?
MonsterX AI remembers your codebase across chats.