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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}
Description
US Phone Number -- doesn't check to see if first digit is legal (not a 0 or 1).
Matches
(123) 456-7890 | 123-456-7890
Non-Matches
1234567890
Author Rating: Not yet rated. Steven Smith
Source http://aspalliance.com/QuickStart/howto/doc/RegexCommon.aspx
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: Pattern
Name: Pertho Chowdhury
Date: 12/19/2020 9:59:51 PM
Comment:
1855653311


Title: test
Name: satheesh
Date: 12/5/2018 9:06:03 AM
Comment:
sat


Title: plz call me now 03038073323
Name: ibrar hussain
Date: 11/2/2012 10:38:15 PM
Comment:
love is S


Title: Phone Expression
Name: DZ
Date: 4/30/2003 3:32:17 PM
Comment:
Works for me just find also made a small enhancement to allow .- and sp ((\(\d{3}\) ?)|(\d{3}[- \.]))?\d{3}[- \.]\d{4}


Title: web monkey
Name: shane
Date: 4/22/2003 12:57:57 PM
Comment:
simply doesnt work. nice try though


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