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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find US Telephone
Expression
^\(?([0-9]{3})\)?[\s\.\-]*([0-9]{3})[\s\.\-]*([0-9]{4})$
Description
Basically I didn't like any of the regular expressions that were available because they all failed at parsing them into variables correctly... This regular expression gives you the full match and then the 3 sections of digits seperately.
Matches
(000) 000-0000, 0000000000, 000.000.0000
Non-Matches
000/000/0000, 00a.000.000, +000.000.0000
Author Rating: The rating for this expression. Mike Willbanks
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

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