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}))([\s-./]?)(\d{3})([\s-./]?)(\d{4})
Description
US Phone number that accept a dot, a space, a dash, a forward slash, between the numbers. Will Accept a 1 or 0 in front. Area Code not necessary
Matches
1.2123644567 | 0-234.567/8912 | 1-(212)-123 4567
Non-Matches
0-212364345 | 1212-364,4321 | 0212\345/6789
Author Rating: The rating for this expression. Mart Maasikas
Source Steven Smith
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: Doesn't work properly
Name: Bill
Date: 6/12/2019 9:19:02 PM
Comment:
It correctly matches 4 digits at the end, but if there is any character beyond the 4 digits, it still matches. I think all it needs is a $ at the end of the regex.


Title: Doesn't work properly
Name: Bill
Date: 6/12/2019 9:16:01 PM
Comment:
It correctly matches 4 digits at the end, but if there is any character beyond the 4 digits, it still matches. I think all it needs is a $ at the end of the regex.


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