node-phonenumber
Version:
Google's phone number handling library ported to Node
1,476 lines (1,446 loc) • 873 kB
text/xml
<!-- Copyright (C) 2009 The Libphonenumber Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@author: Shaopeng Jia
Metadata on Phone Number Plan and formatting rules
Note: Territories are in alphabetical order by their IDs, which are based on CLDR
two-letter region codes (or are set to "001" for non-geographical entities, which
represents "World" in the UN M.49 standard). The country names in the comments are the
official short names in English according to CLDR.
For more information on what each element represents, see
resources/phonemetadata.proto
Note that if you want to add validation metadata, the generalDesc nationalNumberPattern must be
provided. If this is missing, then the country will be considered to have no more specific
phone-number type metadata (fixedLine, mobile etc) and hence only basic validation rules
(numbers should be between 3 and 15 digits long) will be applied.
If adding an element for a non-geographical entity, please add an example number element to the
general description.
Country code, international and national prefix information main source:
http://www.itu.int/pub/T-SP-E.164C-2011
Known omissions:
* French Southern Territories (id="TF" countryCode="262")
This is not covered due to lack of information about its numbering plan. It has 140
temporary inhabitants.
* Pitcairn Island (id="PN")
This is not supported since evidence seems to be that the 50 inhabitants use satellite
phones.
See also:
https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#unsupported
-->
<!DOCTYPE phoneNumberMetadata [
<!ELEMENT phoneNumberMetadata (territories)>
<!ELEMENT territories (territory+)>
<!ELEMENT territory (references?, availableFormats?, generalDesc, noInternationalDialling?,
areaCodeOptional?, fixedLine?, mobile?, pager?, tollFree?, premiumRate?,
sharedCost?, personalNumber?, voip?, uan?, voicemail?)>
<!ELEMENT references (sourceUrl+)>
<!ELEMENT generalDesc (nationalNumberPattern)>
<!ELEMENT noInternationalDialling (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT areaCodeOptional (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT fixedLine (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT mobile (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT pager (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT tollFree (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT premiumRate (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT sharedCost (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT personalNumber (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT voip (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT uan (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT voicemail (possibleLengths, exampleNumber, nationalNumberPattern)>
<!ELEMENT sourceUrl (#PCDATA)>
<!ELEMENT availableFormats (numberFormat+)>
<!ELEMENT nationalNumberPattern (#PCDATA)>
<!ELEMENT exampleNumber (#PCDATA)>
<!ELEMENT numberFormat (leadingDigits*, format, intlFormat*)>
<!ELEMENT format (#PCDATA)>
<!ELEMENT intlFormat (#PCDATA)>
<!ELEMENT leadingDigits (#PCDATA)>
<!ELEMENT possibleLengths EMPTY>
<!ATTLIST territory id CDATA #REQUIRED>
<!ATTLIST territory countryCode CDATA #REQUIRED>
<!ATTLIST territory mainCountryForCode (true) #IMPLIED>
<!ATTLIST territory leadingDigits CDATA #IMPLIED>
<!ATTLIST territory preferredInternationalPrefix CDATA #IMPLIED>
<!ATTLIST territory internationalPrefix CDATA #IMPLIED>
<!ATTLIST territory nationalPrefix CDATA #IMPLIED>
<!ATTLIST territory nationalPrefixForParsing CDATA #IMPLIED>
<!ATTLIST territory nationalPrefixTransformRule CDATA #IMPLIED>
<!ATTLIST territory preferredExtnPrefix CDATA #IMPLIED>
<!ATTLIST territory nationalPrefixFormattingRule CDATA #IMPLIED>
<!ATTLIST territory nationalPrefixOptionalWhenFormatting (true) #IMPLIED>
<!ATTLIST territory carrierCodeFormattingRule CDATA #IMPLIED>
<!ATTLIST territory mobileNumberPortableRegion (true) #IMPLIED>
<!ATTLIST possibleLengths national CDATA #REQUIRED>
<!ATTLIST possibleLengths localOnly CDATA #IMPLIED>
<!ATTLIST numberFormat nationalPrefixFormattingRule CDATA #IMPLIED>
<!ATTLIST numberFormat nationalPrefixOptionalWhenFormatting (true) #IMPLIED>
<!ATTLIST numberFormat carrierCodeFormattingRule CDATA #IMPLIED>
<!ATTLIST numberFormat pattern CDATA #REQUIRED>
]>
<phoneNumberMetadata>
<territories>
<!-- Ascension Island -->
<territory id="AC" countryCode="247" internationalPrefix="00">
<references>
<sourceUrl>http://www.itu.int/oth/T02020000AF/en</sourceUrl>
</references>
<!-- Formatted as a block. -->
<generalDesc>
<nationalNumberPattern>
[46]\d{4}|
[01589]\d{5}
</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="5"/>
<exampleNumber>62889</exampleNumber>
<nationalNumberPattern>6[2-467]\d{3}</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="5"/>
<exampleNumber>40123</exampleNumber>
<!-- Note prefix 4 is reserved for mobile use , not currently in use -->
<nationalNumberPattern>4\d{4}</nationalNumberPattern>
</mobile>
<uan>
<possibleLengths national="6"/>
<exampleNumber>542011</exampleNumber>
<nationalNumberPattern>[01589]\d{5}</nationalNumberPattern>
</uan>
</territory>
<!-- Andorra -->
<territory id="AD" countryCode="376" internationalPrefix="00">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000005/en</sourceUrl>
</references>
<availableFormats>
<numberFormat pattern="(\d{3})(\d{3})">
<leadingDigits>
[137-9]|
6[0-8]
</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(\d{4})(\d{4})">
<leadingDigits>180</leadingDigits>
<leadingDigits>180[02]</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(\d{3})(\d{3})(\d{3})">
<leadingDigits>690</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>
[16]\d{5,8}|
[37-9]\d{5}
</nationalNumberPattern>
</generalDesc>
<!-- DO NOT USE <exampleNumber> : TO BE DELETED -->
<noInternationalDialling>
<possibleLengths national="8"/>
<exampleNumber>18000000</exampleNumber>
<nationalNumberPattern>1800\d{4}</nationalNumberPattern>
</noInternationalDialling>
<fixedLine>
<possibleLengths national="6"/>
<exampleNumber>712345</exampleNumber>
<nationalNumberPattern>[78]\d{5}</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="6,9"/>
<exampleNumber>312345</exampleNumber>
<nationalNumberPattern>
(?:
3\d|
6(?:
[0-8]|
90\d{2}
)
)\d{4}
</nationalNumberPattern>
</mobile>
<tollFree>
<possibleLengths national="8"/>
<exampleNumber>18001234</exampleNumber>
<!-- Note that the definitions of 1800 and 1802 numbers differ in the plan and on the
Andorran http://www.sta.ad website, but we consider both to be freephone here. -->
<nationalNumberPattern>180[02]\d{4}</nationalNumberPattern>
</tollFree>
<!-- The national numbering plan says that 6-digit numbers beginning with 1 and 9 are reserved
for special services, so we assume they are premium rate here, although we cannot find
examples online. -->
<premiumRate>
<possibleLengths national="6"/>
<exampleNumber>912345</exampleNumber>
<nationalNumberPattern>[19]\d{5}</nationalNumberPattern>
</premiumRate>
</territory>
<!-- United Arab Emirates -->
<territory id="AE" countryCode="971" internationalPrefix="00" nationalPrefix="0"
nationalPrefixFormattingRule="$NP$FG">
<references>
<sourceUrl>http://www.itu.int/oth/T02020000DC/en</sourceUrl>
</references>
<availableFormats>
<numberFormat pattern="([2-4679])(\d{3})(\d{4})">
<leadingDigits>[2-4679][2-8]</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="(5\d)(\d{3})(\d{4})">
<leadingDigits>5</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="([479]00)(\d)(\d{5})" nationalPrefixFormattingRule="$FG">
<leadingDigits>[479]00</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="([68]00)(\d{2,9})" nationalPrefixFormattingRule="$FG">
<leadingDigits>[68]00</leadingDigits>
<format>$1 $2</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>
[2-79]\d{7,8}|
800\d{2,9}
</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="8" localOnly="7"/>
<exampleNumber>22345678</exampleNumber>
<nationalNumberPattern>[2-4679][2-8]\d{6}</nationalNumberPattern>
</fixedLine>
<!-- Prefixes 54 and 58 are mentioned on Wikipedia,
https://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Arab_Emirates. -->
<mobile>
<possibleLengths national="9"/>
<exampleNumber>501234567</exampleNumber>
<nationalNumberPattern>5[024-68]\d{7}</nationalNumberPattern>
</mobile>
<tollFree>
<possibleLengths national="[5-12]"/>
<exampleNumber>800123456</exampleNumber>
<nationalNumberPattern>
400\d{6}|
800\d{2,9}
</nationalNumberPattern>
</tollFree>
<premiumRate>
<possibleLengths national="9"/>
<exampleNumber>900234567</exampleNumber>
<nationalNumberPattern>900[02]\d{5}</nationalNumberPattern>
</premiumRate>
<sharedCost>
<possibleLengths national="9"/>
<exampleNumber>700012345</exampleNumber>
<nationalNumberPattern>700[05]\d{5}</nationalNumberPattern>
</sharedCost>
<uan>
<possibleLengths national="9"/>
<exampleNumber>600212345</exampleNumber>
<nationalNumberPattern>600[25]\d{5}</nationalNumberPattern>
</uan>
</territory>
<!-- Afghanistan -->
<territory id="AF" countryCode="93" internationalPrefix="00" nationalPrefix="0"
nationalPrefixFormattingRule="$NP$FG">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000001/en</sourceUrl>
</references>
<availableFormats>
<!-- Formatting based primarily on ITU document. -->
<numberFormat pattern="([2-7]\d)(\d{3})(\d{4})">
<leadingDigits>[2-7]</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>[2-7]\d{8}</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="9" localOnly="7"/>
<exampleNumber>234567890</exampleNumber>
<nationalNumberPattern>
(?:
[25][0-8]|
[34][0-4]|
6[0-5]
)[2-9]\d{6}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="9"/>
<exampleNumber>701234567</exampleNumber>
<nationalNumberPattern>
7(?:
[014-9]\d|
2[89]|
30
)\d{6}
</nationalNumberPattern>
</mobile>
</territory>
<!-- Antigua and Barbuda -->
<!-- Calling code and formatting shared with 'US' -->
<territory id="AG" countryCode="1" leadingDigits="268" internationalPrefix="011"
nationalPrefix="1">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000008/en</sourceUrl>
</references>
<generalDesc>
<nationalNumberPattern>[2589]\d{9}</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2684601234</exampleNumber>
<!-- 268 468 is not in the plan, but has been added after numbers with this prefix have been
found in online searches. -->
<nationalNumberPattern>
268(?:
4(?:
6[0-38]|
84
)|
56[0-2]
)\d{4}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2684641234</exampleNumber>
<!-- 268 776/778/779 are not in the plan, but have been added after numbers with these
prefixes have been found in online searches. Same for 268 780/782/784/786. -->
<nationalNumberPattern>
268(?:
464|
7(?:
1[3-9]|
2\d|
3[246]|
64|
7[0-689]|
8[02-68]
)
)\d{4}
</nationalNumberPattern>
</mobile>
<pager>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2684061234</exampleNumber>
<nationalNumberPattern>26840[69]\d{4}</nationalNumberPattern>
</pager>
<tollFree>
<possibleLengths national="10"/>
<exampleNumber>8002123456</exampleNumber>
<nationalNumberPattern>
8(?:
00|
33|
44|
55|
66|
77|
88
)[2-9]\d{6}
</nationalNumberPattern>
</tollFree>
<premiumRate>
<possibleLengths national="10"/>
<exampleNumber>9002123456</exampleNumber>
<nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
</premiumRate>
<personalNumber>
<possibleLengths national="10"/>
<exampleNumber>5002345678</exampleNumber>
<!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
<nationalNumberPattern>
5(?:
00|
22|
33|
44|
66|
77|
88
)[2-9]\d{6}
</nationalNumberPattern>
</personalNumber>
<voip>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2684801234</exampleNumber>
<!-- This is included as Centrex in the plan. -->
<nationalNumberPattern>26848[01]\d{4}</nationalNumberPattern>
</voip>
</territory>
<!-- Anguilla -->
<!-- Calling code and formatting shared with 'US' -->
<territory id="AI" countryCode="1" leadingDigits="264" internationalPrefix="011"
nationalPrefix="1">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000007/en</sourceUrl>
</references>
<generalDesc>
<nationalNumberPattern>[2589]\d{9}</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2644612345</exampleNumber>
<nationalNumberPattern>
2644(?:
6[12]|
9[78]
)\d{4}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2642351234</exampleNumber>
<nationalNumberPattern>
264(?:
235|
476|
5(?:
3[6-9]|
8[1-4]
)|
7(?:
29|
72
)
)\d{4}
</nationalNumberPattern>
</mobile>
<tollFree>
<possibleLengths national="10"/>
<exampleNumber>8002123456</exampleNumber>
<nationalNumberPattern>
8(?:
00|
33|
44|
55|
66|
77|
88
)[2-9]\d{6}
</nationalNumberPattern>
</tollFree>
<premiumRate>
<possibleLengths national="10"/>
<exampleNumber>9002123456</exampleNumber>
<nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
</premiumRate>
<personalNumber>
<possibleLengths national="10"/>
<exampleNumber>5002345678</exampleNumber>
<!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
<nationalNumberPattern>
5(?:
00|
22|
33|
44|
66|
77|
88
)[2-9]\d{6}
</nationalNumberPattern>
</personalNumber>
</territory>
<!-- Albania -->
<territory id="AL" countryCode="355" internationalPrefix="00" nationalPrefix="0"
nationalPrefixFormattingRule="$NP$FG" mobileNumberPortableRegion="true">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000002/en</sourceUrl>
</references>
<availableFormats>
<!-- Formats mostly follow http://tirana.usembassy.gov/list_of_doctors.html -->
<numberFormat pattern="(4)(\d{3})(\d{4})">
<leadingDigits>4[0-6]</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="(6\d)(\d{3})(\d{4})">
<leadingDigits>6</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="(\d{2})(\d{3})(\d{3})">
<leadingDigits>
[2358][2-5]|
4[7-9]
</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="(\d{3})(\d{3,5})">
<leadingDigits>
[235][16-9]|
[79]|
8[016-9]
</leadingDigits>
<format>$1 $2</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>
[2-57]\d{7}|
6\d{8}|
8\d{5,7}|
9\d{5}
</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="8" localOnly="[5-7]"/>
<exampleNumber>22345678</exampleNumber>
<nationalNumberPattern>
(?:
[2358](?:
[16-9]\d[2-9]|
[2-5][2-9]\d
)|
4(?:
[2-57-9][2-9]\d|
6\d{2}
)
)\d{4}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="9"/>
<exampleNumber>662123456</exampleNumber>
<!-- More specific prefixes from the 1.NumraAlokuar.rar file linked from the ITU doc. -->
<nationalNumberPattern>
6(?:
[689][2-9]|
7[2-6]
)\d{6}
</nationalNumberPattern>
</mobile>
<tollFree>
<possibleLengths national="7"/>
<exampleNumber>8001234</exampleNumber>
<nationalNumberPattern>800\d{4}</nationalNumberPattern>
</tollFree>
<premiumRate>
<possibleLengths national="6"/>
<exampleNumber>900123</exampleNumber>
<!-- It is named "Shared Revenue Services" in the plan, but as there is a separate "Shared
Cost Services", it is highly likely these numbers are premium rate numbers. No
information/example is found in the Internet. -->
<nationalNumberPattern>900[1-9]\d{2}</nationalNumberPattern>
</premiumRate>
<sharedCost>
<possibleLengths national="6"/>
<exampleNumber>808123</exampleNumber>
<nationalNumberPattern>808[1-9]\d{2}</nationalNumberPattern>
</sharedCost>
<personalNumber>
<possibleLengths national="8"/>
<exampleNumber>70021234</exampleNumber>
<nationalNumberPattern>700[2-9]\d{4}</nationalNumberPattern>
</personalNumber>
</territory>
<!-- Armenia -->
<!-- We think the national dialling prefix is 0 - it seems this was a change in 2005 (or 2008)
along with the new city codes. However, their official document makes no mention of it,
websites disagree, and we are not sure if the change has actually been made. -->
<territory id="AM" countryCode="374" internationalPrefix="00" nationalPrefix="0"
nationalPrefixFormattingRule="($NP$FG)" mobileNumberPortableRegion="true">
<references>
<sourceUrl>http://www.itu.int/oth/T020200000A/en</sourceUrl>
<sourceUrl>http://en.wikipedia.org/wiki/%2B374</sourceUrl>
<sourceUrl>http://en.wikipedia.org/wiki/Telephone_numbers_in_Nagorno-Karabakh_Republic</sourceUrl>
</references>
<availableFormats>
<numberFormat pattern="(\d{2})(\d{6})">
<leadingDigits>
1|
47
</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
<leadingDigits>
4[1349]|
[5-7]|
88|
9[1-9]
</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(\d{3})(\d{5})">
<leadingDigits>[23]</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(\d{3})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP $FG">
<leadingDigits>
8|
90
</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>[1-9]\d{7}</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="8" localOnly="5,6"/>
<exampleNumber>10123456</exampleNumber>
<!-- Includes telephone numbers in Nagorno-Karabakh Republic, physically located inside
Azerbaijan, which use prefix 47. -->
<nationalNumberPattern>
(?:
1[0-2]\d|
2(?:
2[2-46]|
3[1-8]|
4[2-69]|
5[2-7]|
6[1-9]|
8[1-7]
)|
3[12]2|
47\d
)\d{5}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="8"/>
<exampleNumber>77123456</exampleNumber>
<!-- Part of the range 97 is used by Nagorno-Karabakh Republic. -->
<nationalNumberPattern>
(?:
4[1349]|
55|
77|
88|
9[1-9]
)\d{6}
</nationalNumberPattern>
</mobile>
<tollFree>
<possibleLengths national="8"/>
<exampleNumber>80012345</exampleNumber>
<nationalNumberPattern>800\d{5}</nationalNumberPattern>
</tollFree>
<premiumRate>
<possibleLengths national="8"/>
<exampleNumber>90012345</exampleNumber>
<nationalNumberPattern>90[016]\d{5}</nationalNumberPattern>
</premiumRate>
<sharedCost>
<possibleLengths national="8"/>
<exampleNumber>80112345</exampleNumber>
<nationalNumberPattern>80[1-4]\d{5}</nationalNumberPattern>
</sharedCost>
<voip>
<possibleLengths national="8"/>
<exampleNumber>60271234</exampleNumber>
<nationalNumberPattern>
60(?:
2[078]|
[3-7]\d|
8[0-5]
)\d{4}
</nationalNumberPattern>
</voip>
</territory>
<!-- Angola -->
<territory id="AO" countryCode="244" internationalPrefix="00">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000006/en</sourceUrl>
</references>
<availableFormats>
<numberFormat pattern="(\d{3})(\d{3})(\d{3})">
<format>$1 $2 $3</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>[29]\d{8}</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="9"/>
<exampleNumber>222123456</exampleNumber>
<nationalNumberPattern>
2\d(?:
[26-9]\d|
\d[26-9]
)\d{5}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="9"/>
<exampleNumber>923123456</exampleNumber>
<!-- Expanded the 92 prefix possibilities to match numbers found online. Unitel
apparently launched the prefix 94 on 25th April 2012, and Movicel has 99. -->
<nationalNumberPattern>9[1-49]\d{7}</nationalNumberPattern>
</mobile>
</territory>
<!-- Argentina -->
<!-- The national prefix for parsing here consists of a 0 (optional), followed by the area code
(which is captured, so that it can be retained), followed by 15, which is the mobile token,
which will be stripped if present. We expect the following combinations: 0AC15 and AC15
(where the 0 and 15 will be stripped, and it will be transformed into 9AC), 0, and 15 (in
the latter two cases we just strip the 0 or 15 as appropriate and leave the number as is.) -->
<territory id="AR" countryCode="54" internationalPrefix="00" nationalPrefix="0"
nationalPrefixForParsing="
0?(?:
(
11|
2(?:
2(?:
02?|
[13]|
2[13-79]|
4[1-6]|
5[2457]|
6[124-8]|
7[1-4]|
8[13-6]|
9[1267]
)|
3(?:
02?|
1[467]|
2[03-6]|
3[13-8]|
[49][2-6]|
5[2-8]|
[67]
)|
4(?:
7[3-578]|
9
)|
6(?:
[0136]|
2[24-6]|
4[6-8]?|
5[15-8]
)|
80|
9(?:
0[1-3]|
[19]|
2\d|
3[1-6]|
4[02568]?|
5[2-4]|
6[2-46]|
72?|
8[23]?
)
)|
3(?:
3(?:
2[79]|
6|
8[2578]
)|
4(?:
0[0-24-9]|
[12]|
3[5-8]?|
4[24-7]|
5[4-68]?|
6[02-9]|
7[126]|
8[2379]?|
9[1-36-8]
)|
5(?:
1|
2[1245]|
3[237]?|
4[1-46-9]|
6[2-4]|
7[1-6]|
8[2-5]?
)|
6[24]|
7(?:
[069]|
1[1568]|
2[15]|
3[145]|
4[13]|
5[14-8]|
7[2-57]|
8[126]
)|
8(?:
[01]|
2[15-7]|
3[2578]?|
4[13-6]|
5[4-8]?|
6[1-357-9]|
7[36-8]?|
8[5-8]?|
9[124]
)
)
)?15
)?"
nationalPrefixTransformRule="9$1" nationalPrefixFormattingRule="$NP$FG"
mobileNumberPortableRegion="true">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000009/en</sourceUrl>
<sourceUrl>https://www.enacom.gob.ar/indicativos-de-servicio_p141</sourceUrl>
<sourceUrl>https://www.enacom.gob.ar/indicativos-interurbanos_p143</sourceUrl>
<sourceUrl>http://en.wikipedia.org/wiki/+54</sourceUrl>
</references>
<availableFormats>
<numberFormat pattern="([68]\d{2})(\d{3})(\d{4})">
<leadingDigits>[68]</leadingDigits>
<format>$1-$2-$3</format>
</numberFormat>
<!-- Format local numbers in two groups. The leading digits are 2-9 since the ITU document
says that the digit zero and one will not be present at the start of the subscriber
number (which starts with an "Exchange characteristic"). -->
<numberFormat pattern="(\d{2})(\d{4})" nationalPrefixFormattingRule="$FG">
<leadingDigits>[2-9]</leadingDigits>
<format>$1-$2</format>
<intlFormat>NA</intlFormat>
</numberFormat>
<numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$FG">
<leadingDigits>[2-9]</leadingDigits>
<format>$1-$2</format>
<intlFormat>NA</intlFormat>
</numberFormat>
<numberFormat pattern="(\d{4})(\d{4})" nationalPrefixFormattingRule="$FG">
<leadingDigits>[2-9]</leadingDigits>
<format>$1-$2</format>
<intlFormat>NA</intlFormat>
</numberFormat>
<numberFormat pattern="(9)(11)(\d{4})(\d{4})">
<leadingDigits>911</leadingDigits>
<format>$2 15-$3-$4</format>
<intlFormat>$1 $2 $3-$4</intlFormat>
</numberFormat>
<numberFormat pattern="(9)(\d{3})(\d{3})(\d{4})">
<!-- The regular expressions below were generated semi-automatically from data extracted
from the XLS spreadsheet downloaded from the "Númeración Geográfica" link cited
above. Each pattern captures all 3-3-4 prefixes for its length, but may also capture
some 4-2-4 cases.
In cases where a range contains both 3-3-4 and 4-2-4 prefixes, the most commonly used
one should be considered the default.
* If there are more distinct 4-2-4 prefixes, then the regular expression should
INCLUDE only the explicitly mentioned 3-3-4 prefixes.
* If there are more distinct 3-3-4 prefixes, then the regular expression should
EXCLUDE only the explicitly mentioned 4-2-4 prefixes.
This should help maximize the chances of new ranges automatically being assigned to
the right form.
In the final (most specific) regular expression, the few remaining ambiguous cases
are decided by comparing usage counts. Any manual edits to these expressions not
reflected in the XLS spreadsheet must be clearly called out below:
Added Manually as 3-3-4 format:
* 2981 (General Roca, Río Negro) : Numbers found online suggest 3-3-4
See also:
https://github.com/googlei18n/libphonenumber/issues/611
https://github.com/googlei18n/libphonenumber/issues/559 -->
<!-- Do NOT copy this into the section below. Removing the leading '9' will make it match
only 2 digits and the first <leadingDigits> section must always match 3 digits. -->
<leadingDigits>
9(?:
2[2-4689]|
3[3-8]
)
</leadingDigits>
<!-- If modified, copy this expression into the section below, minus the leading '9' -->
<leadingDigits>
9(?:
2(?:
2[013]|
3[067]|
49|
6[01346]|
8|
9[147-9]
)|
3(?:
36|
4[1-358]|
5[138]|
6|
7[069]|
8[013578]
)
)
</leadingDigits>
<!-- Note that some patterns appear as both 3 and 4 digit area codes. In these cases
(to avoid going to 6 digits of discrimination) we simply pick the one with the
most uses. Patterns excluded from this expression will be treated as 4-2-4:
- XXXX (usage count as 3-digit code:usage count as 4-digit code)
- 2646 (7:15) - excluded
- 3435 (39:63) - excluded
- 3454 (90:48)
- 3455 (13:94) - excluded
- 3456 (3:93) - excluded
- 3584 (143:65)
- 3585 (21:42) - excluded
- 3854 (115:73)
- 3855 (76:40)
- 3856 (19:44) - excluded
- 3876 (56:99) - excluded
- 3885 (120:45)
- 3886 (3:137) - excluded -->
<!-- If modified, copy this expression into the section below, minus the leading '9' -->
<leadingDigits>
9(?:
2(?:
2(?:
0[013-9]|
[13]
)|
3(?:
0[013-9]|
[67]
)|
49|
6(?:
[0136]|
4[0-59]
)|
8|
9(?:
[19]|
44|
7[013-9]|
8[14]
)
)|
3(?:
36|
4(?:
[12]|
3[4-6]|
[58]4
)|
5(?:
1|
3[0-24-689]|
8[46]
)|
6|
7[069]|
8(?:
[01]|
34|
[578][45]
)
)
)
</leadingDigits>
<!-- If modified, copy this expression into the section below, minus the leading '9'. -->
<!-- We go to 6-digit on a case-by-case basis. Below are the prefixes we have added
support up to 6-digit: 9343. -->
<leadingDigits>
9(?:
2(?:
2(?:
0[013-9]|
[13]
)|
3(?:
0[013-9]|
[67]
)|
49|
6(?:
[0136]|
4[0-59]
)|
8|
9(?:
[19]|
44|
7[013-9]|
8[14]
)
)|
3(?:
36|
4(?:
[12]|
3(?:
4|
5[014]|
6[1-39]
)|
[58]4
)|
5(?:
1|
3[0-24-689]|
8[46]
)|
6|
7[069]|
8(?:
[01]|
34|
[578][45]
)
)
)
</leadingDigits>
<format>$2 15-$3-$4</format>
<intlFormat>$1 $2 $3-$4</intlFormat>
</numberFormat>
<!-- Both 4-3-3 and 4-2-4 have been seen online; we prefer the latter since it matches the
Argentinian ITU doc and wikipedia. -->
<numberFormat pattern="(9)(\d{4})(\d{2})(\d{4})">
<leadingDigits>9[23]</leadingDigits>
<format>$2 15-$3-$4</format>
<intlFormat>$1 $2 $3-$4</intlFormat>
</numberFormat>
<numberFormat pattern="(11)(\d{4})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
<leadingDigits>11</leadingDigits>
<format>$1 $2-$3</format>
</numberFormat>
<!-- These patterns are a copy of the mobile patterns with the leading 9 removed. -->
<numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
<!-- Never modify this manually, always copy from above and remove leading '9' -->
<leadingDigits>
2(?:
2[013]|
3[067]|
49|
6[01346]|
8|
9[147-9]
)|
3(?:
36|
4[1-358]|
5[138]|
6|
7[069]|
8[013578]
)
</leadingDigits>
<!-- Never modify this manually, always copy from above and remove leading '9' -->
<leadingDigits>
2(?:
2(?:
0[013-9]|
[13]
)|
3(?:
0[013-9]|
[67]
)|
49|
6(?:
[0136]|
4[0-59]
)|
8|
9(?:
[19]|
44|
7[013-9]|
8[14]
)
)|
3(?:
36|
4(?:
[12]|
3[4-6]|
[58]4
)|
5(?:
1|
3[0-24-689]|
8[46]
)|
6|
7[069]|
8(?:
[01]|
34|
[578][45]
)
)
</leadingDigits>
<leadingDigits>
2(?:
2(?:
0[013-9]|
[13]
)|
3(?:
0[013-9]|
[67]
)|
49|
6(?:
[0136]|
4[0-59]
)|
8|
9(?:
[19]|
44|
7[013-9]|
8[14]
)
)|
3(?:
36|
4(?:
[12]|
3(?:
4|
5[014]|
6[1-39]
)|
[58]4
)|
5(?:
1|
3[0-24-689]|
8[46]
)|
6|
7[069]|
8(?:
[01]|
34|
[578][45]
)
)
</leadingDigits>
<format>$1 $2-$3</format>
</numberFormat>
<numberFormat pattern="(\d{4})(\d{2})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
<leadingDigits>[23]</leadingDigits>
<format>$1 $2-$3</format>
</numberFormat>
<!-- Format short numbers as a block. -->
<numberFormat pattern="(\d{3})" nationalPrefixFormattingRule="$FG">
<leadingDigits>
1[0-2]|
911
</leadingDigits>
<format>$1</format>
<intlFormat>NA</intlFormat>
</numberFormat>
</availableFormats>
<!-- We restrict the second digit after 1 here so we can recognise and strip the 15 mobile
carrier prefix when we see it. -->
<generalDesc>
<nationalNumberPattern>
11\d{8}|
[2368]\d{9}|
9\d{10}
</nationalNumberPattern>
</generalDesc>
<!-- DO NOT USE <exampleNumber> : TO BE DELETED -->
<noInternationalDialling>
<possibleLengths national="10"/>
<exampleNumber>8101234567</exampleNumber>
<nationalNumberPattern>810\d{7}</nationalNumberPattern>
</noInternationalDialling>
<fixedLine>
<possibleLengths national="10" localOnly="[6-8]"/>
<exampleNumber>1123456789</exampleNumber>
<!-- Also covering fixed satellite service numbers (670). -->
<nationalNumberPattern>
11\d{8}|
(?:
2(?:
2(?:
[013]\d|
2[13-79]|
4[1-6]|
5[2457]|
6[124-8]|
7[1-4]|
8[13-6]|
9[1267]
)|
3(?:
1[467]|
2[03-6]|
3[13-8]|
[49][2-6]|
5[2-8]|
[067]\d
)|
4(?:
7[3-8]|
9\d
)|
6(?:
[01346]\d|
2[24-6]|
5[15-8]
)|
80\d|
9(?:
[0124789]\d|
3[1-6]|
5[234]|
6[2-46]
)
)|
3(?:
3(?:
2[79]|
6\d|
8[2578]
)|
4(?:
[78]\d|
0[0124-9]|
[1-35]\d|
4[24-7]|
6[02-9]|
9[123678]
)|
5(?:
[138]\d|
2[1245]|
4[1-9]|
6[2-4]|
7[1-6]
)|
6[24]\d|
7(?:
[0469]\d|
1[1568]|
2[013-9]|
3[145]|
5[14-8]|
7[2-57]|
8[0-24-9]
)|
8(?:
[013578]\d|
2[15-7]|
4[13-6]|
6[1-357-9]|
9[124]
)
)|
670\d
)\d{6}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="10,11" localOnly="[6-8]"/>
<exampleNumber>91123456789</exampleNumber>
<!-- Also covers mobile satellite services (675 numbers). -->
<!-- 4-digit area codes are not covered here in detail - we only check the digit after the
area code is in the range 2-9. The four-digit area-code checking is done in detail if
we attempt to strip the caller-pays token (15) from the number. -->
<nationalNumberPattern>
675\d{7}|
9(?:
11[2-9]\d{7}|
(?:
2(?:
2[013]|
3[067]|
49|
6[01346]|
80|
9[147-9]
)|
3(?:
36|
4[12358]|
5[138]|
6[24]|
7[069]|
8[013578]
)
)[2-9]\d{6}|
\d{4}[2-9]\d{5}
)
</nationalNumberPattern>
</mobile>
<tollFree>
<possibleLengths national="10"/>
<exampleNumber>8001234567</exampleNumber>
<nationalNumberPattern>800\d{7}</nationalNumberPattern>
</tollFree>
<premiumRate>
<possibleLengths national="10"/>
<exampleNumber>6001234567</exampleNumber>
<nationalNumberPattern>60[04579]\d{7}</nationalNumberPattern>
</premiumRate>
<uan>
<possibleLengths national="10"/>
<exampleNumber>8101234567</exampleNumber>
<nationalNumberPattern>810\d{7}</nationalNumberPattern>
</uan>
</territory>
<!-- American Samoa -->
<!-- Calling code and formatting shared with 'US' -->
<territory id="AS" countryCode="1" leadingDigits="684" internationalPrefix="011"
nationalPrefix="1">
<references>
<sourceUrl>http://www.itu.int/oth/T0202000004/en</sourceUrl>
</references>
<generalDesc>
<nationalNumberPattern>[5689]\d{9}</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>6846221234</exampleNumber>
<nationalNumberPattern>
6846(?:
22|
33|
44|
55|
77|
88|
9[19]
)\d{4}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>6847331234</exampleNumber>
<!-- Added 25[246] and 272, operated by Blue Sky. Added 731, 770, operated by ASTCA. -->
<nationalNumberPattern>
684(?:
2(?:
5[2468]|
72
)|
7(?:
3[13]|
70
)
)\d{4}
</nationalNumberPattern>
</mobile>
<tollFree>
<possibleLengths national="10"/>
<exampleNumber>8002123456</exampleNumber>
<nationalNumberPattern>
8(?:
00|
33|
44|
55|
66|
77|
88
)[2-9]\d{6}
</nationalNumberPattern>
</tollFree>
<premiumRate>
<possibleLengths national="10"/>
<exampleNumber>9002123456</exampleNumber>
<nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
</premiumRate>
<personalNumber>
<possibleLengths national="10"/>
<exampleNumber>5002345678</exampleNumber>
<!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
<nationalNumberPattern>
5(?:
00|
22|
33|
44|
66|
77|
88
)[2-9]\d{6}
</nationalNumberPattern>
</personalNumber>
</territory>
<!-- Austria -->
<territory id="AT" countryCode="43" internationalPrefix="00" nationalPrefix="0"
nationalPrefixFormattingRule="$NP$FG" mobileNumberPortableRegion="true">
<references>
<sourceUrl>http://www.rtr.at/en/tk/E129</sourceUrl>
</references>
<availableFormats>
<numberFormat pattern="(116\d{3})" nationalPrefixFormattingRule="$FG">
<leadingDigits>116</leadingDigits>
<format>$1</format>
</numberFormat>
<numberFormat pattern="(1)(\d{3,12})">
<leadingDigits>1</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<!-- The following three patterns are the most common for prefixes 050, 057 and 059, as
found on Austrian web pages. -->
<numberFormat pattern="(5\d)(\d{3,5})">
<leadingDigits>5[079]</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(5\d)(\d{3})(\d{3,4})">
<leadingDigits>5[079]</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="(5\d)(\d{4})(\d{4,7})">
<leadingDigits>5[079]</leadingDigits>
<format>$1 $2 $3</format>
</numberFormat>
<numberFormat pattern="(\d{3})(\d{3,10})">
<leadingDigits>
(?:
31|
4
)6|
51|
6(?:
5[0-3579]|
[6-9]
)|
7(?:
[28]0|
32
)|
[89]
</leadingDigits>
<format>$1 $2</format>
</numberFormat>
<numberFormat pattern="(\d{4})(\d{3,9})">
<leadingDigits>
2|
3(?:
1[1-578]|
[3-8]
)|
4[2378]|
5[2-6]|
6(?:
[12]|
4[1-9]|
5[468]
)|
7(?:
[24][1-8]|
35|
[5-79]
)
</leadingDigits>
<format>$1 $2</format>
</numberFormat>
</availableFormats>
<generalDesc>
<nationalNumberPattern>[1-9]\d{3,12}</nationalNumberPattern>
</generalDesc>
<fixedLine>
<possibleLengths national="[4-13]" localOnly="3"/>
<exampleNumber>1234567890</exampleNumber>
<!-- Note that the full area code is not validated - just the first 3 digits. This also
means that even though for most Austrian numbers the minimum l