Posted By

binarynomad on 11/11/08


Tagged

regex phone-us


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

jeremyhcobb
jadb
Tyster


US Phone Numbers


 / Published in: Regular Expression
 

US phone with or without parentheses

  1. ([0-9]{3}\)\s?[0-9]{3}(-|\s)?[0-9]{4}$|^[0-9]{3}-?[0-9]{3}-?[0-9]{4}

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Scooter on November 11, 2008

Periods are also valid separators. Area codes cannot start with 0 or 1.

You need to login to post a comment.