RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Ultimate Phone Number Regex (international + USA)
Expression
^((\+)?[1-9]{1,4})?([-\s\.\/])?((\(\d{1,4}\))|\d{1,4})(([-\s\.\/])?[0-9]{1,6}){2,6}(\s?(ext|x)\s?[0-9]{1,6})?$
Description
After searching for one, I just said "screw it" and wrote my own, and here she is. A regular expression to match against phone numbers, both international and USA! Very VERY flexible, if I do say so myself (and I do).
Matches
555-955-5555 | 5555555555 | +1(773).9554-8946 | +1-(773)+95548946 ext 8875 | 1/(773)/9554/8946x563 | (00)7-901-759-92-61ext15
Non-Matches
$%^&* (of course not)
Author Rating: The rating for this expression. Xunnamius
Source My mind
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials