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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Capture International Phone Numbers
Expression
^011-(?<IntlCountryCode>[1-9][0-9]{1,5})-(?<IntlAreaCode>[0-9]+)-(?<IntlPhoneNumber>[0]?\d[0-9]+)(?:[^\d\-]+(?<IntlExtension>\d{1,4}))?$
Description
Requires the International Phone Number to be separated into its component parts by dashes ("011-CC-AC-PH EXT" where "CC" is the 1 to 5 digit country code, "AC" is the area code, "PH" is the phone number, and "EXT" is the optional 1 to 4 digit extension.) (The separator before extension is one or more characters that are not a dash or a number.) This allows explicit parsing/extraction of the extension. Also Captures international phone number components, including an optional extension into named groups.
Matches
011-12345-67-8901234|011-12345-67-8901234 5678
Non-Matches
123-456-7890|123-456-7890 1234
Author Rating: Not yet rated. Ananda Tracy
Source Developed to the specifications on http://en.wikipedia.org/wiki/Telephone_numbering_plan
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