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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find International Phone Number Capture
Expression
^011-(?<IntlCountryCode>[1-9][0-9]{1,5})-(?<IntlAreaCode>[0-9]+)-(?<IntlPhoneNumber>[0]?\d[0-9]+)(?:[^\d\-]+(?<IntlExtension>\d{1,4}))?$
Description
International Phone Number separated into its component parts by dashes (International Country Code, International Area Code, International Phone Number, and optional 1-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.
Matches
011-44-020-123456 ext. 1234 | 011-44-020-123456 1234 | 011-44-020-123456 x1234
Non-Matches
44-020-123456 ext. 1234 | 123-456-7890
Author Rating: Not yet rated. Ananda Tracy
Source developed from the international standards posted at 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-2025, RegexAdvice.com | ASP.NET Tutorials