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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Any use phone number with support for extensions
Expression
\(?\s*(?<area>\d{3})\s*[\)\.\-]?\s*(?<first>\d{3})\s*[\-\.]?\s*(?<second>\d{4})\D*(?<ext>\d*)
Description
Matches any properly entered US phone number (area code, first three, last four) plus support for extensions (optional)
Matches
5551213333 555.111.1234 555.888.8888x4444
Non-Matches
555-555-123
Author Rating: Not yet rated. Paul
Source
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

Title: Not so good
Name: Tester
Date: 3/30/2007 10:00:05 AM
Comment:
It has no problem matching real numbers I don't think, but, it probably shouldn't match something like this 905643432187777693568907623422 which it does match.


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