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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find US Phone Number - Normalization
Expression
^([\.\"\'-/ \(/)\s\[\]\\\,\<\>\;\:\{\}]?)([0-9]{3})([\.\"\'-/\(/)\s\[\]\\\,\<\>\;\:\{\}]?)([0-9]{3})([\,\.\"\'-/\(/)\s\[\]\\\<\>\;\:\{\}]?)([0-9]{4})$
Description
This RE recognizes unformatted US phone numbers. The replacement string is $2-$4-$6. Helps when you want to normalize the phone numbers in a DB field.This also identifies a single space given before are after the part of first, second 3 digits and before the last 4 digits. The replaced format will be "123-456-7890"
Matches
(123)-123/2345 1234567890 123-123-2345 123/234\8976 333.334,3456
Non-Matches
(1234567890 jdfojsdoj) ( 3456789098) (sdfhdih 675-576-9087)
Author Rating: The rating for this expression. Mukundh
Source own
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