Validationflags: g

US Phone Number

Match US phone numbers in common formats: (555) 867-5309, 555-867-5309, 5558675309.

Try it in RegexPro

Pattern

regexJavaScript
/\(?\d{3}\)?[\s.\-]?\d{3}[\s.\-]?\d{4}/g

Raw source: \(?\d{3}\)?[\s.\-]?\d{3}[\s.\-]?\d{4}

How it works

The optional \(? and \)? allow parentheses around the area code. The [\s.\-]? between groups allows spaces, dots, or hyphens as optional separators.

Examples

Input

(555) 867-5309

Matches

  • (555) 867-5309

Input

555.867.5309

Matches

  • 555.867.5309

Input

5558675309

Matches

  • 5558675309

Common use cases

  • Contact form validation
  • Extracting phone numbers from documents
  • CRM data normalisation
  • Marketing list cleaning
All patternsTest this pattern live →