mobi/telephone_number

View on GitHub
data/telephone_number_data_file.xml

Summary

Maintainability
Test Coverage
 <!-- 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/google/libphonenumber/blob/master/FAQ.md#unsupported
     -->

<!DOCTYPE phoneNumberMetadata [
    <!ELEMENT phoneNumberMetadata (territories)>
    <!ELEMENT territories (territory+)>
    <!ELEMENT territory (references?, availableFormats?, generalDesc, noInternationalDialling?,
        fixedLine?, mobile?, pager?, tollFree?, premiumRate?,
        sharedCost?, personalNumber?, voip?, uan?, voicemail?)>
    <!ELEMENT references (sourceUrl+)>
    <!ELEMENT generalDesc (nationalNumberPattern)>
    <!ELEMENT noInternationalDialling (possibleLengths, 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 (AC) -->
    <!-- http://www.itu.int/oth/T02020000AF/en -->
    <territory id="AC" countryCode="247" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [01589]\d|
            [46]
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="5"/>
        <exampleNumber>62889</exampleNumber>
        <nationalNumberPattern>6[2-467]\d{3}</nationalNumberPattern>
      </fixedLine>
      <!-- Note prefix 4 is reserved for mobile use , not currently in use -->
      <mobile>
        <possibleLengths national="5"/>
        <exampleNumber>40123</exampleNumber>
        <nationalNumberPattern>4\d{4}</nationalNumberPattern>
      </mobile>
      <!-- Omit '00' as a prefix since that's the IDD prefix. -->
      <uan>
        <possibleLengths national="6"/>
        <exampleNumber>542011</exampleNumber>
        <nationalNumberPattern>
          (?:
            0[1-9]|
            [1589]\d
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Andorra (AD) -->
    <!-- http://www.itu.int/oth/T0202000005/en -->
    <territory id="AD" countryCode="376" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>[135-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1|
            6\d
          )\d{7}|
          [135-9]\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="8"/>
        <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>
          690\d{6}|
          [356]\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- 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. -->
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>18001234</exampleNumber>
        <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 (AE) -->
    <!-- http://www.itu.int/oth/T02020000DC/en -->
    <territory id="AE" countryCode="971" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2,9})">
          <leadingDigits>
            60|
            8
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [236]|
            [479][2-8]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d)(\d{5})">
          <leadingDigits>[479]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>5</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [4-7]\d|
            9[0-689]
          )\d{7}|
          800\d{2,9}|
          [2-4679]\d{7}
        </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 (AF) -->
    <!-- http://www.itu.int/oth/T0202000001/en -->
    <territory id="AF" countryCode="93" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[1-9]</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Formatting based primarily on ITU document. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <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>
      <!-- 731 range is supported based on user report. -->
      <mobile>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>701234567</exampleNumber>
        <nationalNumberPattern>7\d{8}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Antigua & Barbuda (AG) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000008/en -->
    <territory id="AG" countryCode="1" leadingDigits="268" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([457]\d{6})$|1"
               nationalPrefixTransformRule="268$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            268|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 268 468 is not in the plan, but has been added after numbers with this prefix have been
           found in online searches. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2684601234</exampleNumber>
        <nationalNumberPattern>
          268(?:
            4(?:
              6[0-38]|
              84
            )|
            56[0-2]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 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 782/784/786/789. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2684641234</exampleNumber>
        <nationalNumberPattern>
          268(?:
            464|
            7(?:
              1[3-9]|
              [28]\d|
              3[0246]|
              64|
              7[0-689]
            )
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <!-- This is included as Centrex in the plan. -->
      <voip>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2684801234</exampleNumber>
        <nationalNumberPattern>26848[01]\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Anguilla (AI) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000007/en -->
    <territory id="AI" countryCode="1" leadingDigits="264" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2457]\d{6})$|1"
               nationalPrefixTransformRule="264$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            264|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2644612345</exampleNumber>
        <nationalNumberPattern>
          264(?:
            292|
            4(?:
              6[12]|
              9[78]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2642351234</exampleNumber>
        <nationalNumberPattern>
          264(?:
            235|
            4(?:
              69|
              76
            )|
            5(?:
              3[6-9]|
              8[1-4]
            )|
            7(?:
              29|
              72
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2647241234</exampleNumber>
        <nationalNumberPattern>264724\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Albania (AL) -->
    <!-- http://www.itu.int/oth/T0202000002/en -->
    <territory id="AL" countryCode="355" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Premium rate or toll free formats -->
        <numberFormat pattern="(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            80|
            9
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Formats mostly follow http://tirana.usembassy.gov/list_of_doctors.html -->
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>4[2-6]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [2358][2-5]|
            4
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[23578]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            700\d\d|
            900
          )\d{3}|
          8\d{5,7}|
          (?:
            [2-5]|
            6\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8" localOnly="[5-7]"/>
        <exampleNumber>22345678</exampleNumber>
        <nationalNumberPattern>
          4505[0-2]\d{3}|
          (?:
            [2358][16-9]\d[2-9]|
            4410
          )\d{4}|
          (?:
            [2358][2-5][2-9]|
            4(?:
              [2-57-9][2-9]|
              6\d
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- More specific prefixes from the 1.NumraAlokuar.rar file linked from the ITU doc.
           Though 677 is mentioned as unallocated in
           http://akep.al/images/stories/AKEP/plani-numracionit/1.NumraAlokuar.rar,
           adding support for 67[7-9] based on carrier doc. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>672123456</exampleNumber>
        <nationalNumberPattern>
          6(?:
            [78][2-9]|
            9\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>800\d{4}</nationalNumberPattern>
      </tollFree>
      <!-- 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. -->
      <premiumRate>
        <possibleLengths national="6"/>
        <exampleNumber>900123</exampleNumber>
        <nationalNumberPattern>900[1-9]\d\d</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="6"/>
        <exampleNumber>808123</exampleNumber>
        <nationalNumberPattern>808[1-9]\d\d</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>70021234</exampleNumber>
        <nationalNumberPattern>700[2-9]\d{4}</nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Armenia (AM) -->
    <!-- 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. -->
    <!-- http://www.itu.int/oth/T020200000A/en -->
    <!-- http://en.wikipedia.org/wiki/%2B374 -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Nagorno-Karabakh_Republic -->
    <territory id="AM" countryCode="374" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>[89]0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2|
            3[12]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            1|
            47
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[3-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [1-489]\d|
            55|
            60|
            77
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Includes telephone numbers in Nagorno-Karabakh Republic, physically located inside
           Azerbaijan, which use prefix 47. -->
      <fixedLine>
        <possibleLengths national="8" localOnly="5,6"/>
        <exampleNumber>10123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              1[0-25]|
              47
            )\d|
            2(?:
              2[2-46]|
              3[1-8]|
              4[2-69]|
              5[2-7]|
              6[1-9]|
              8[1-7]
            )|
            3[12]2
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Part of the range 97 is used by Nagorno-Karabakh Republic. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>77123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            33|
            4[1349]|
            55|
            77|
            88|
            9[13-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[78]|
            3[5-9]|
            4[02-9]|
            5[0-46-9]|
            [6-8]\d|
            9[0-2]
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Angola (AO) -->
    <!-- http://www.itu.int/oth/T0202000006/en -->
    <territory id="AO" countryCode="244" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>[29]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[29]\d{8}</nationalNumberPattern>
      </generalDesc>
      <!-- Supporting 2Y5 and 2YY5 ranges (where Y and YY represent one and two digit area code)
           based on user report and format followed in ITU doc. Wikipedia also mentions that
           "Fixed-line numbers start with digit 2, followed by 1 or 2 digits area code. After the
           area code, there is one digit telecoms operator code. So now we are adding 5 as telecom
           operator code now." -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>222123456</exampleNumber>
        <nationalNumberPattern>
          2\d(?:
            [0134][25-9]|
            [25-9]\d
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Expanded the 92 prefix possibilities to match numbers found online. Unitel
           apparently launched the prefix 94 on 25th April 2012, and Movicel has 99. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>923123456</exampleNumber>
        <nationalNumberPattern>9[1-59]\d{7}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Argentina (AR) -->
    <!-- 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.) -->
    <!-- http://www.itu.int/oth/T0202000009/en -->
    <!-- https://www.enacom.gob.ar/indicativos-de-servicio_p141 -->
    <!-- https://www.enacom.gob.ar/indicativos-interurbanos_p143 -->
    <!-- http://en.wikipedia.org/wiki/+54 -->
    <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" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Format short numbers as a block. -->
        <numberFormat pattern="(\d{3})">
          <leadingDigits>
            0|
            1(?:
              0[0-35-7]|
              1[02-5]|
              2[015]|
              3[47]|
              4[478]
            )|
            911
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})">
          <leadingDigits>[1-9]</leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[1-8]</leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            2(?:
              2[024-9]|
              3[0-59]|
              47|
              6[245]|
              9[02-8]
            )|
            3(?:
              3[28]|
              4[03-9]|
              5[2-46-8]|
              7[1-578]|
              8[2-9]
            )
          </leadingDigits>
          <leadingDigits>
            2(?:
              [23]02|
              6(?:
                [25]|
                4[6-8]
              )|
              9(?:
                [02356]|
                4[02568]|
                72|
                8[23]
              )
            )|
            3(?:
              3[28]|
              4(?:
                [04679]|
                3[5-8]|
                5[4-68]|
                8[2379]
              )|
              5(?:
                [2467]|
                3[237]|
                8[2-5]
              )|
              7[1-578]|
              8(?:
                [2469]|
                3[2578]|
                5[4-8]|
                7[36-8]|
                8[5-8]
              )
            )|
            2(?:
              2[24-9]|
              3[1-59]|
              47
            )
          </leadingDigits>
          <leadingDigits>
            2(?:
              [23]02|
              6(?:
                [25]|
                4(?:
                  64|
                  [78]
                )
              )|
              9(?:
                [02356]|
                4(?:
                  [0268]|
                  5[2-6]
                )|
                72|
                8[23]
              )
            )|
            3(?:
              3[28]|
              4(?:
                [04679]|
                3[78]|
                5(?:
                  4[46]|
                  8
                )|
                8[2379]
              )|
              5(?:
                [2467]|
                3[237]|
                8[23]
              )|
              7[1-578]|
              8(?:
                [2469]|
                3[278]|
                5[56][46]|
                86[3-6]
              )
            )|
            2(?:
              2[24-9]|
              3[1-59]|
              47
            )|
            38(?:
              [58][78]|
              7[378]
            )|
            3(?:
              4[35][56]|
              58[45]|
              8(?:
                [38]5|
                54|
                76
              )
            )[4-6]
          </leadingDigits>
          <leadingDigits>
            2(?:
              [23]02|
              6(?:
                [25]|
                4(?:
                  64|
                  [78]
                )
              )|
              9(?:
                [02356]|
                4(?:
                  [0268]|
                  5[2-6]
                )|
                72|
                8[23]
              )
            )|
            3(?:
              3[28]|
              4(?:
                [04679]|
                3(?:
                  5(?:
                    4[0-25689]|
                    [56]
                  )|
                  [78]
                )|
                58|
                8[2379]
              )|
              5(?:
                [2467]|
                3[237]|
                8(?:
                  [23]|
                  4(?:
                    [45]|
                    60
                  )|
                  5(?:
                    4[0-39]|
                    5|
                    64
                  )
                )
              )|
              7[1-578]|
              8(?:
                [2469]|
                3[278]|
                54(?:
                  4|
                  5[13-7]|
                  6[89]
                )|
                86[3-6]
              )
            )|
            2(?:
              2[24-9]|
              3[1-59]|
              47
            )|
            38(?:
              [58][78]|
              7[378]
            )|
            3(?:
              454|
              85[56]
            )[46]|
            3(?:
              4(?:
                36|
                5[56]
              )|
              8(?:
                [38]5|
                76
              )
            )[4-6]
          </leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <!-- Formatting for geographic numbers (including those which can be dialled with a mobile token). -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <!-- Various non-geographic numbers, including UAN, premium rate but also some mobile
             ranges. We assume no local dialling is possible for these ranges. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[68]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[23]</leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{2})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            9(?:
              2[2-469]|
              3[3-578]
            )
          </leadingDigits>
          <leadingDigits>
            9(?:
              2(?:
                2[024-9]|
                3[0-59]|
                47|
                6[245]|
                9[02-8]
              )|
              3(?:
                3[28]|
                4[03-9]|
                5[2-46-8]|
                7[1-578]|
                8[2-9]
              )
            )
          </leadingDigits>
          <leadingDigits>
            9(?:
              2(?:
                [23]02|
                6(?:
                  [25]|
                  4[6-8]
                )|
                9(?:
                  [02356]|
                  4[02568]|
                  72|
                  8[23]
                )
              )|
              3(?:
                3[28]|
                4(?:
                  [04679]|
                  3[5-8]|
                  5[4-68]|
                  8[2379]
                )|
                5(?:
                  [2467]|
                  3[237]|
                  8[2-5]
                )|
                7[1-578]|
                8(?:
                  [2469]|
                  3[2578]|
                  5[4-8]|
                  7[36-8]|
                  8[5-8]
                )
              )
            )|
            92(?:
              2[24-9]|
              3[1-59]|
              47
            )
          </leadingDigits>
          <leadingDigits>
            9(?:
              2(?:
                [23]02|
                6(?:
                  [25]|
                  4(?:
                    64|
                    [78]
                  )
                )|
                9(?:
                  [02356]|
                  4(?:
                    [0268]|
                    5[2-6]
                  )|
                  72|
                  8[23]
                )
              )|
              3(?:
                3[28]|
                4(?:
                  [04679]|
                  3[78]|
                  5(?:
                    4[46]|
                    8
                  )|
                  8[2379]
                )|
                5(?:
                  [2467]|
                  3[237]|
                  8[23]
                )|
                7[1-578]|
                8(?:
                  [2469]|
                  3[278]|
                  5(?:
                    [56][46]|
                    [78]
                  )|
                  7[378]|
                  8(?:
                    6[3-6]|
                    [78]
                  )
                )
              )
            )|
            92(?:
              2[24-9]|
              3[1-59]|
              47
            )|
            93(?:
              4[35][56]|
              58[45]|
              8(?:
                [38]5|
                54|
                76
              )
            )[4-6]
          </leadingDigits>
          <leadingDigits>
            9(?:
              2(?:
                [23]02|
                6(?:
                  [25]|
                  4(?:
                    64|
                    [78]
                  )
                )|
                9(?:
                  [02356]|
                  4(?:
                    [0268]|
                    5[2-6]
                  )|
                  72|
                  8[23]
                )
              )|
              3(?:
                3[28]|
                4(?:
                  [04679]|
                  3(?:
                    5(?:
                      4[0-25689]|
                      [56]
                    )|
                    [78]
                  )|
                  5(?:
                    4[46]|
                    8
                  )|
                  8[2379]
                )|
                5(?:
                  [2467]|
                  3[237]|
                  8(?:
                    [23]|
                    4(?:
                      [45]|
                      60
                    )|
                    5(?:
                      4[0-39]|
                      5|
                      64
                    )
                  )
                )|
                7[1-578]|
                8(?:
                  [2469]|
                  3[278]|
                  5(?:
                    4(?:
                      4|
                      5[13-7]|
                      6[89]
                    )|
                    [56][46]|
                    [78]
                  )|
                  7[378]|
                  8(?:
                    6[3-6]|
                    [78]
                  )
                )
              )
            )|
            92(?:
              2[24-9]|
              3[1-59]|
              47
            )|
            93(?:
              4(?:
                36|
                5[56]
              )|
              8(?:
                [38]5|
                76
              )
            )[4-6]
          </leadingDigits>
          <format>$2 15-$3-$4</format>
          <intlFormat>$1 $2 $3-$4</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>91</leadingDigits>
          <format>$2 15-$3-$4</format>
          <intlFormat>$1 $2 $3-$4</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$2 15-$3-$4</format>
          <intlFormat>$1 $2 $3-$4</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            11|
            [89]\d\d
          )\d{8}|
          [2368]\d{9}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="10"/>
        <nationalNumberPattern>810\d{7}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- Also covering fixed satellite service numbers (670). -->
      <fixedLine>
        <possibleLengths national="10" localOnly="[6-8]"/>
        <exampleNumber>1123456789</exampleNumber>
        <nationalNumberPattern>
          3888[013-9]\d{5}|
          3(?:
            7(?:
              1[15]|
              81
            )|
            8(?:
              21|
              4[16]|
              69|
              9[12]
            )
          )[46]\d{5}|
          (?:
            2(?:
              657|
              9(?:
                54|
                66
              )
            )|
            3(?:
              7(?:
                55|
                77
              )|
              865
            )
          )[2-8]\d{5}|
          (?:
            2(?:
              2(?:
                2[59]|
                44|
                52
              )|
              3(?:
                26|
                44
              )|
              473|
              9(?:
                [07]2|
                2[26]|
                34|
                46
              )
            )|
            3327
          )[45]\d{5}|
          (?:
            2(?:
              284|
              3(?:
                02|
                23
              )|
              920
            )|
            3(?:
              4(?:
                46|
                8[27]|
                92
              )|
              541|
              878
            )
          )[2-7]\d{5}|
          (?:
            2(?:
              (?:
                26|
                62
              )2|
              320|
              477|
              9(?:
                42|
                83
              )
            )|
            3(?:
              329|
              4(?:
                62|
                76|
                89
              )|
              564
            )
          )[2-6]\d{5}|
          (?:
            (?:
              11[1-8]|
              670
            )\d|
            2(?:
              2(?:
                0[45]|
                1[2-6]|
                3[3-6]
              )|
              3(?:
                [06]4|
                7[45]
              )|
              494|
              6(?:
                04|
                1[2-8]|
                [36][45]|
                4[3-6]
              )|
              80[45]|
              9(?:
                [17][4-6]|
                [48][45]|
                9[3-6]
              )
            )|
            3(?:
              364|
              4(?:
                1[2-8]|
                [235][4-6]|
                84
              )|
              5(?:
                1[2-9]|
                [38][4-6]
              )|
              6(?:
                2[45]|
                44
              )|
              7[069][45]|
              8(?:
                0[45]|
                [17][2-6]|
                3[4-6]|
                [58][3-6]
              )
            )
          )\d{6}|
          2(?:
            2(?:
              21|
              4[23]|
              6[145]|
              7[1-4]|
              8[356]|
              9[267]
            )|
            3(?:
              16|
              3[13-8]|
              43|
              5[346-8]|
              9[3-5]
            )|
            475|
            6(?:
              2[46]|
              4[78]|
              5[1568]
            )|
            9(?:
              03|
              2[1457-9]|
              3[1356]|
              4[08]|
              [56][23]|
              82
            )
          )4\d{5}|
          (?:
            2(?:
              2(?:
                57|
                81
              )|
              3(?:
                24|
                46|
                92
              )|
              9(?:
                01|
                23|
                64
              )
            )|
            3(?:
              4(?:
                42|
                71
              )|
              5(?:
                25|
                37|
                4[347]|
                71
              )|
              7(?:
                18|
                5[17]
              )
            )
          )[3-6]\d{5}|
          (?:
            2(?:
              2(?:
                02|
                2[3467]|
                4[156]|
                5[45]|
                6[6-8]|
                91
              )|
              3(?:
                1[47]|
                25|
                [45][25]|
                96
              )|
              47[48]|
              625|
              932
            )|
            3(?:
              38[2578]|
              4(?:
                0[0-24-9]|
                3[78]|
                4[457]|
                58|
                6[03-9]|
                72|
                83|
                9[136-8]
              )|
              5(?:
                2[124]|
                [368][23]|
                4[2689]|
                7[2-6]
              )|
              7(?:
                16|
                2[15]|
                3[145]|
                4[13]|
                5[468]|
                7[2-5]|
                8[26]
              )|
              8(?:
                2[5-7]|
                3[278]|
                4[3-5]|
                5[78]|
                6[1-378]|
                [78]7|
                94
              )
            )
          )[4-6]\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Also covers mobile satellite services (675 numbers). -->
      <mobile>
        <possibleLengths national="10,11" localOnly="[6-8]"/>
        <exampleNumber>91123456789</exampleNumber>
        <nationalNumberPattern>
          93(?:
            7(?:
              1[15]|
              81
            )[46]|
            8(?:
              (?:
                21|
                4[16]|
                69|
                9[12]
              )[46]|
              88[013-9]
            )
          )\d{5}|
          9(?:
            2(?:
              657|
              9(?:
                54|
                66
              )
            )|
            3(?:
              7(?:
                55|
                77
              )|
              865
            )
          )[2-8]\d{5}|
          9(?:
            2(?:
              2(?:
                2[59]|
                44|
                52
              )|
              3(?:
                26|
                44
              )|
              473|
              9(?:
                [07]2|
                2[26]|
                34|
                46
              )
            )|
            3327
          )[45]\d{5}|
          9(?:
            2(?:
              284|
              3(?:
                02|
                23
              )|
              920
            )|
            3(?:
              4(?:
                46|
                8[27]|
                92
              )|
              541|
              878
            )
          )[2-7]\d{5}|
          9(?:
            2(?:
              (?:
                26|
                62
              )2|
              320|
              477|
              9(?:
                42|
                83
              )
            )|
            3(?:
              329|
              4(?:
                62|
                76|
                89
              )|
              564
            )
          )[2-6]\d{5}|
          (?:
            675\d|
            9(?:
              11[1-8]\d|
              2(?:
                2(?:
                  0[45]|
                  1[2-6]|
                  3[3-6]
                )|
                3(?:
                  [06]4|
                  7[45]
                )|
                494|
                6(?:
                  04|
                  1[2-8]|
                  [36][45]|
                  4[3-6]
                )|
                80[45]|
                9(?:
                  [17][4-6]|
                  [48][45]|
                  9[3-6]
                )
              )|
              3(?:
                364|
                4(?:
                  1[2-8]|
                  [235][4-6]|
                  84
                )|
                5(?:
                  1[2-9]|
                  [38][4-6]
                )|
                6(?:
                  2[45]|
                  44
                )|
                7[069][45]|
                8(?:
                  0[45]|
                  [17][2-6]|
                  3[4-6]|
                  [58][3-6]
                )
              )
            )
          )\d{6}|
          92(?:
            2(?:
              21|
              4[23]|
              6[145]|
              7[1-4]|
              8[356]|
              9[267]
            )|
            3(?:
              16|
              3[13-8]|
              43|
              5[346-8]|
              9[3-5]
            )|
            475|
            6(?:
              2[46]|
              4[78]|
              5[1568]
            )|
            9(?:
              03|
              2[1457-9]|
              3[1356]|
              4[08]|
              [56][23]|
              82
            )
          )4\d{5}|
          9(?:
            2(?:
              2(?:
                57|
                81
              )|
              3(?:
                24|
                46|
                92
              )|
              9(?:
                01|
                23|
                64
              )
            )|
            3(?:
              4(?:
                42|
                71
              )|
              5(?:
                25|
                37|
                4[347]|
                71
              )|
              7(?:
                18|
                5[17]
              )
            )
          )[3-6]\d{5}|
          9(?:
            2(?:
              2(?:
                02|
                2[3467]|
                4[156]|
                5[45]|
                6[6-8]|
                91
              )|
              3(?:
                1[47]|
                25|
                [45][25]|
                96
              )|
              47[48]|
              625|
              932
            )|
            3(?:
              38[2578]|
              4(?:
                0[0-24-9]|
                3[78]|
                4[457]|
                58|
                6[03-9]|
                72|
                83|
                9[136-8]
              )|
              5(?:
                2[124]|
                [368][23]|
                4[2689]|
                7[2-6]
              )|
              7(?:
                16|
                2[15]|
                3[145]|
                4[13]|
                5[468]|
                7[2-5]|
                8[26]
              )|
              8(?:
                2[5-7]|
                3[278]|
                4[3-5]|
                5[78]|
                6[1-378]|
                [78]7|
                94
              )
            )
          )[4-6]\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10,11"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7,8}</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 (AS) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000004/en -->
    <territory id="AS" countryCode="1" leadingDigits="684" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([267]\d{6})$|1"
               nationalPrefixTransformRule="684$1">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            684|
            900
          )\d{7}
        </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>
      <!-- Added 25[246] and 272, operated by Blue Sky. Added 731, 770, operated by ASTCA. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6847331234</exampleNumber>
        <nationalNumberPattern>
          684(?:
            2(?:
              48|
              5[2468]|
              7[26]
            )|
            7(?:
              3[13]|
              70|
              82
            )
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Austria (AT) -->
    <!-- http://www.rtr.at/en/tk/E129 -->
    <territory id="AT" countryCode="43" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Shortcode format -->
        <numberFormat pattern="(\d{4})">
          <leadingDigits>14</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Vienna (Wien) fixed line format (1-digit area code). -->
        <numberFormat pattern="(\d)(\d{3,12})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              11|
              [2-9]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- VOIP (517xx only, which seems like the only VOIP range with a 3-digit prefix). -->
        <numberFormat pattern="(\d{3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>517</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- VOIP (5-7 digits).
             These formats are the most common for prefixes 050, 057 and 059, as found on Austrian web pages. -->
        <numberFormat pattern="(\d{2})(\d{3,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>5[079]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Shortcode format -->
        <numberFormat pattern="(\d{6})">
          <leadingDigits>[18]</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 3-digit area codes (fixed line, including premium rate and toll free). -->
        <numberFormat pattern="(\d{3})(\d{3,10})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              31|
              4
            )6|
            51|
            6(?:
              5[0-3579]|
              [6-9]
            )|
            7(?:
              20|
              32|
              8
            )|
            [89]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 4-digit area codes (fixed line only). -->
        <numberFormat pattern="(\d{4})(\d{3,9})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [2-467]|
            5[2-6]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- VOIP (8-9 digits). -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>5</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- VOIP (10-13 digits). -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>5</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1\d{3,12}|
          2\d{6,12}|
          43(?:
            (?:
              0\d|
              5[02-9]
            )\d{3,9}|
            2\d{4,5}|
            [3467]\d{4}|
            8\d{4,6}|
            9\d{4,7}
          )|
          5\d{4,12}|
          8\d{7,12}|
          9\d{8,12}|
          (?:
            [367]\d|
            4[0-24-9]
          )\d{4,11}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 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 length is 7, we allow 6
           since we don't differentiate below between 3 and 4 digit area codes for reasons of
           efficiency. -->
      <fixedLine>
        <possibleLengths national="[4-13]" localOnly="3"/>
        <exampleNumber>1234567890</exampleNumber>
        <nationalNumberPattern>
          1(?:
            11\d|
            [2-9]\d{3,11}
          )|
          (?:
            316|
            463|
            (?:
              51|
              66|
              73
            )2
          )\d{3,10}|
          (?:
            2(?:
              1[467]|
              2[13-8]|
              5[2357]|
              6[1-46-8]|
              7[1-8]|
              8[124-7]|
              9[1458]
            )|
            3(?:
              1[1-578]|
              3[23568]|
              4[5-7]|
              5[1378]|
              6[1-38]|
              8[3-68]
            )|
            4(?:
              2[1-8]|
              35|
              7[1368]|
              8[2457]
            )|
            5(?:
              2[1-8]|
              3[357]|
              4[147]|
              5[12578]|
              6[37]
            )|
            6(?:
              13|
              2[1-47]|
              4[135-8]|
              5[468]
            )|
            7(?:
              2[1-8]|
              35|
              4[13478]|
              5[68]|
              6[16-8]|
              7[1-6]|
              9[45]
            )
          )\d{4,10}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="[7-13]"/>
        <exampleNumber>664123456</exampleNumber>
        <nationalNumberPattern>
          6(?:
            5[0-3579]|
            6[013-9]|
            [7-9]\d
          )\d{4,10}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[9-13]"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6,10}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="[9-13]"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            8[69][2-68]|
            9(?:
              0[01]|
              3[019]
            )
          )\d{6,10}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="[8-13]"/>
        <exampleNumber>810123456</exampleNumber>
        <nationalNumberPattern>
          8(?:
            10|
            2[018]
          )\d{6,10}|
          828\d{5}
        </nationalNumberPattern>
      </sharedCost>
      <!-- Convergent service numbers 780 are supported here as VOIP is closest match for such
           numbers. All location independent corporate numbers are supported as we found these
           are dialled via IP. -->
      <voip>
        <possibleLengths national="[5-13]"/>
        <exampleNumber>780123456</exampleNumber>
        <nationalNumberPattern>
          5(?:
            0[1-9]|
            17|
            [79]\d
          )\d{2,10}|
          7[28]0\d{6,10}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Australia (AU) -->
    <!-- Main region for 'CC,CX' -->
    <!-- International prefix based on the wikipedia page, either being a combination of the
         "Provider override codes" with the default IDD (0011) following, or the default IDD,
         or the other IDD codes for non-default carriers. -->
    <!-- http://www.itu.int/oth/T020200000D/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Australia -->
    <!-- https://www.thenumberingsystem.com.au/#/number-register/search -->
    <territory id="AU" mainCountryForCode="true" countryCode="61"
               preferredInternationalPrefix="0011"
               internationalPrefix="001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011"
               nationalPrefix="0" nationalPrefixForParsing="(183[12])|0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Pager (5-6 digits) -->
        <numberFormat pattern="(\d{2})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>16</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 6-digit variable cost fixed line (toll free, premium rate, shared cost) -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})">
          <leadingDigits>13</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Premium rate SMS (6 digit) -->
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>19</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 7-digit variable cost fixed line (toll free, premium rate, shared cost) -->
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>180</leadingDigits>
          <leadingDigits>1802</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Premium rate SMS (7-8 digit) -->
        <numberFormat pattern="(\d{4})(\d{3,4})">
          <leadingDigits>19</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Pager (7-9 digits) -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>16</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile and VOIP -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            14|
            4
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line -->
        <numberFormat pattern="(\d)(\d{4})(\d{4})" nationalPrefixFormattingRule="($NP$FG)"
                      carrierCodeFormattingRule="$CC ($FG)">
          <leadingDigits>[2378]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 10-digit variable cost fixed line (toll free, premium rate, shared cost) -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>
            1(?:
              30|
              [89]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})(\d{4})">
          <leadingDigits>130</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1(?:
            [0-79]\d{7}(?:
              \d(?:
                \d{2}
              )?
            )?|
            8[0-24-9]\d{7}
          )|
          [2-478]\d{8}|
          1\d{4,7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="[6-8],10,12"/>
        <nationalNumberPattern>
          1(?:
            3(?:
              00\d{5}|
              45[0-4]
            )|
            802
          )\d{3}|
          1[38]00\d{6}|
          13\d{4}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- Note: Excludes prefixes used by Cocos Islands and Christmas Islands. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="8"/>
        <exampleNumber>212345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              (?:
                2(?:
                  [0-26-9]\d|
                  3[0-8]|
                  4[02-9]|
                  5[0135-9]
                )|
                7(?:
                  [013-57-9]\d|
                  2[0-8]
                )
              )\d|
              3(?:
                (?:
                  [0-3589]\d|
                  6[1-9]|
                  7[0-35-9]
                )\d|
                4(?:
                  [0-578]\d|
                  90
                )
              )
            )\d\d|
            8(?:
              51(?:
                0(?:
                  0[03-9]|
                  [12479]\d|
                  3[2-9]|
                  5[0-8]|
                  6[1-9]|
                  8[0-7]
                )|
                1(?:
                  [0235689]\d|
                  1[0-69]|
                  4[0-589]|
                  7[0-47-9]
                )|
                2(?:
                  0[0-79]|
                  [18][13579]|
                  2[14-9]|
                  3[0-46-9]|
                  [4-6]\d|
                  7[89]|
                  9[0-4]
                )|
                3\d\d
              )|
              (?:
                6[0-8]|
                [78]\d
              )\d{3}|
              9(?:
                [02-9]\d{3}|
                1(?:
                  (?:
                    [0-58]\d|
                    6[0135-9]
                  )\d|
                  7(?:
                    0[0-24-9]|
                    [1-9]\d
                  )|
                  9(?:
                    [0-46-9]\d|
                    5[0-79]
                  )
                )
              )
            )
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Note CC and CX should be updated as well if this pattern changes. Maintaining three digit
           granularity of the ranges mentioned as *assigned* in:
           https://www.thenumberingsystem.com.au/download/EnhancedFullDownload.zip -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>412345678</exampleNumber>
        <nationalNumberPattern>
          4(?:
            (?:
              79|
              94
            )[01]|
            83[0-389]
          )\d{5}|
          4(?:
            [0-3]\d|
            4[047-9]|
            5[0-25-9]|
            6[0-36-9]|
            7[02-8]|
            8[0-24-9]|
            9[0-37-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="[5-9]"/>
        <exampleNumber>1631234</exampleNumber>
        <nationalNumberPattern>163\d{2,6}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="7,10"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          180(?:
            0\d{3}|
            2
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>1900123456</exampleNumber>
        <nationalNumberPattern>190[0-26]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- Local-rate (SmartNumbers) are put here because they are a reverse-charge network,
           although they charge a small local call connect fee (around 25c). These start with 13
           or 1300. Prefix 1300 of length 12 digit added based on user report. -->
      <sharedCost>
        <possibleLengths national="6,8,10,12"/>
        <exampleNumber>1300123456</exampleNumber>
        <nationalNumberPattern>
          13(?:
            00\d{6}(?:
              \d{2}
            )?|
            45[0-4]\d{3}
          )|
          13\d{4}
        </nationalNumberPattern>
      </sharedCost>
      <!-- Includes MobileSat and Thuraya satellite services. According to the wikipedia page,
           other ranges 14[1-3] are not currently used. Supporting them here as VOIP is the closest
           match. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>147101234</exampleNumber>
        <nationalNumberPattern>
          14(?:
            5(?:
              1[0458]|
              [23][458]
            )|
            71\d
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Aruba (AW) -->
    <!-- http://www.itu.int/oth/T020200000B/en -->
    <territory id="AW" countryCode="297" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[25-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [25-79]\d\d|
            800
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>5212345</exampleNumber>
        <nationalNumberPattern>
          5(?:
            2\d|
            8[1-9]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- The prefixes 994 and 96[45], while not in the plan, seem to be used in mobile numbers
           found online. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>5601234</exampleNumber>
        <nationalNumberPattern>
          (?:
            290|
            5[69]\d|
            6(?:
              [03]0|
              22|
              4[0-2]|
              [69]\d
            )|
            7(?:
              [34]\d|
              7[07]
            )|
            9(?:
              6[45]|
              9[4-8]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>800\d{4}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>9001234</exampleNumber>
        <nationalNumberPattern>900\d{4}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>5011234</exampleNumber>
        <nationalNumberPattern>
          (?:
            28\d|
            501
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Åland Islands (AX) -->
    <!-- Calling code and formatting shared with 'FI' -->
    <!-- Adding all international carrier access codes in below doc that we found corroborating
         evidence for. Considering these are available in AX region as well.
         https://www.viestintavirasto.fi/en/internettelephone/numberingoftelecommunicationsnetworks/internationalcalls/internationalcarrieraccesscodes.html -->
    <!-- Not supporting national long distance carrier codes as these are overlapping with UAN
         ranges mentioned in ITU doc. -->
    <!-- https://www.viestintavirasto.fi/internetpuhelin/puhelinverkonnumerointi.html -->
    <territory id="AX" countryCode="358" leadingDigits="18" preferredInternationalPrefix="00"
               internationalPrefix="00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))"
               nationalPrefix="0">
      <generalDesc>
        <nationalNumberPattern>
          2\d{4,9}|
          35\d{4,5}|
          (?:
            60\d\d|
            800
          )\d{4,6}|
          7\d{5,11}|
          (?:
            [14]\d|
            3[0-46-9]|
            50
          )\d{4,8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="[6-9]"/>
        <exampleNumber>181234567</exampleNumber>
        <nationalNumberPattern>18[1-8]\d{3,6}</nationalNumberPattern>
      </fixedLine>
      <!-- The mobile, toll free, premium rate and UAN numbers are copied from Finland. -->
      <!-- Only 8, 9 and 10 digit numbers are possible as per www.viestintavirasto.fi's plan.
           Supporting other lengths based on user reports. -->
      <mobile>
        <possibleLengths national="[6-10]"/>
        <exampleNumber>412345678</exampleNumber>
        <nationalNumberPattern>
          4946\d{2,6}|
          (?:
            4[0-8]|
            50
          )\d{4,8}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[7-9]"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{4,6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8,9"/>
        <exampleNumber>600123456</exampleNumber>
        <nationalNumberPattern>[67]00\d{5,6}</nationalNumberPattern>
      </premiumRate>
      <!-- Covers nationwide non-geographic numbers, and nationwide "service numbers", typically
           assigned to institutions such as universities, the national post, etc, where they are
           not otherwise classified as toll-free or premium-rate numbers. -->
      <uan>
        <possibleLengths national="[5-12]"/>
        <exampleNumber>10112345</exampleNumber>
        <nationalNumberPattern>
          20\d{4,8}|
          60[12]\d{5,6}|
          7(?:
            099\d{4,5}|
            5[03-9]\d{3,7}
          )|
          20[2-59]\d\d|
          (?:
            606|
            7(?:
              0[78]|
              1|
              3\d
            )
          )\d{7}|
          (?:
            10|
            29|
            3[09]|
            70[1-5]\d
          )\d{4,8}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Azerbaijan (AZ) -->
    <!-- http://www.itu.int/oth/T020200000F/en -->
    <territory id="AZ" countryCode="994" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})">
          <leadingDigits>[1-9]</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Premium rate (and maybe other special ranges). -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>90</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            1[28]|
            2|
            365|
            46
          </leadingDigits>
          <leadingDigits>
            1[28]|
            2|
            365[45]|
            46
          </leadingDigits>
          <leadingDigits>
            1[28]|
            2|
            365(?:
              4|
              5[02]
            )|
            46
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- ITU uses XX XXX XXXX for mobile numbers, but numbers online typically
             use XX XXX XX XX. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[13-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          365\d{6}|
          (?:
            [124579]\d|
            60|
            88
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 12109 fixed line numbers are mentioned as "Information Operator Assistance"
           by ITU. Added it to fixedline numbers as whole 12 range numbers are fixedline
           numbers in Baku. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>123123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[12]428|
            3655[02]
          )\d{4}|
          (?:
            2(?:
              22[0-79]|
              63[0-28]
            )|
            3654
          )\d{5}|
          (?:
            (?:
              1[28]|
              46
            )\d|
            2(?:
              [014-6]2|
              [23]3
            )
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Prefix 36554 is added to mobile as per confirmation from Ministry of
           Communications in Azerbaijan. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>401234567</exampleNumber>
        <nationalNumberPattern>
          36554\d{4}|
          (?:
            [16]0|
            4[04]|
            5[015]|
            7[07]|
            99
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- 88 is listed as fixed-line for Baku in the ITU document, but online numbers seem to
           suggest they are in fact national toll-free numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>881234567</exampleNumber>
        <nationalNumberPattern>88\d{7}</nationalNumberPattern>
      </tollFree>
      <!-- These are marked as Interactive Calls in the ITU document. -->
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900200123</exampleNumber>
        <nationalNumberPattern>900200\d{3}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Bosnia & Herzegovina (BA) -->
    <!-- accessible from http://www.cra.ba/en/telecom/numbering/ -->
    <!-- http://www.rak.ba/eng/index.php?uid=1272016657 -->
    <!-- http://en.wikipedia.org/wiki/+387 -->
    <territory id="BA" countryCode="387" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            6[1-3]|
            [7-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [3-5]|
            6[56]
          </leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <!-- 9-digit mobile. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          6\d{8}|
          (?:
            [35689]\d|
            49|
            70
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- For easier maintenance, supporting ranges at 3 digit granularity vs 4 digit granular
           ranges mentioned in RAK's doc. -->
      <fixedLine>
        <possibleLengths national="8" localOnly="6"/>
        <exampleNumber>30212345</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              [05-79][2-9]|
              1[4579]|
              [23][24-9]|
              4[2-4689]|
              8[2457-9]
            )|
            49[2-579]|
            5(?:
              0[2-49]|
              [13][2-9]|
              [268][2-4679]|
              4[4689]|
              5[2-79]|
              7[2-69]|
              9[2-4689]
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8,9"/>
        <exampleNumber>61123456</exampleNumber>
        <nationalNumberPattern>
          6040\d{5}|
          6(?:
            03|
            [1-356]|
            44|
            7\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>8[08]\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>9[0246]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- Using this category to model national tariff numbers - these are under Shared Cost in
           the plan. -->
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>82123456</exampleNumber>
        <nationalNumberPattern>8[12]\d{6}</nationalNumberPattern>
      </sharedCost>
      <!-- Using this to classify nomad numbers. 702[0-4] ranges are no longer mentioned in
           official RAK's doc (Dated 21-11-2017). For easier maintenance, supporting ranges at 4
           digit granularity vs 4 and 5 digit granular ranges mentioned in RAK's doc. -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>70341234</exampleNumber>
        <nationalNumberPattern>
          703[235]0\d{3}|
          70(?:
            2[0-5]|
            3[0146]|
            [56]0
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Barbados (BB) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000013/en -->
    <territory id="BB" countryCode="1" leadingDigits="246" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
               nationalPrefixTransformRule="246$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            246|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Fixed Telephony (ATM/IP) and Fixed Wireless phone numbers are supported here. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2464123456</exampleNumber>
        <nationalNumberPattern>
          246521[0369]\d{3}|
          246(?:
            2(?:
              2[78]|
              7[0-4]
            )|
            4(?:
              1[024-6]|
              2\d|
              3[2-9]
            )|
            5(?:
              20|
              [34]\d|
              54|
              7[1-3]
            )|
            6(?:
              2\d|
              38
            )|
            7[35]7|
            9(?:
              1[89]|
              63
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2462501234</exampleNumber>
        <nationalNumberPattern>
          246(?:
            (?:
              2(?:
                [3568]\d|
                4[0-57-9]
              )|
              3(?:
                5[2-9]|
                6[0-6]
              )|
              4(?:
                46|
                5\d
              )|
              69[5-7]|
              8(?:
                [2-5]\d|
                83
              )
            )\d|
            52(?:
              1[147]|
              20
            )
          )\d{3}
        </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" localOnly="7"/>
        <exampleNumber>9002123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            246976|
            900[2-9]\d\d
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2463101234</exampleNumber>
        <nationalNumberPattern>24631\d{5}</nationalNumberPattern>
      </voip>
      <!-- Call Centres, CENTREX and Direct Inward Dialling (DID) prefixes have been added under
           uan. -->
      <uan>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2464301234</exampleNumber>
        <nationalNumberPattern>
          246(?:
            292|
            367|
            4(?:
              1[7-9]|
              3[01]|
              4[47-9]|
              67
            )|
            7(?:
              1[2-9]|
              2\d|
              3[016]|
              53
            )
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Bangladesh (BD) -->
    <!-- As per official evidence, 001 and 002 can be used for International dialing covering toll
         quality and non-toll quality services. But these are not in use according to our tests
         (see b/29552679). -->
    <!-- http://www.itu.int/oth/T0202000012/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Bangladesh -->
    <!-- http://www.btrc.gov.bd/national-numbering-plan -->
    <territory id="BD" countryCode="880" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            31[5-8]|
            [459]1
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            3(?:
              [67]|
              8[013-9]
            )|
            4(?:
              6[168]|
              7|
              [89][18]
            )|
            5(?:
              6[128]|
              9
            )|
            6(?:
              [15]|
              28|
              4[14]
            )|
            7[2-589]|
            8(?:
              0[014-9]|
              [12]
            )|
            9[358]|
            (?:
              3[2-5]|
              4[235]|
              5[2-578]|
              6[0389]|
              76|
              8[3-7]|
              9[24]
            )1|
            (?:
              44|
              66
            )[01346-9]
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- Mobile numbers, VOIP, and four-digit fixed-line area codes. We use the same format for
             all VOIP numbers as they are not consistent and these ranges are assigned at 4 digit
             granularity. -->
        <numberFormat pattern="(\d{4})(\d{3,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [13-9]|
            22
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{7,8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-469]\d{9}|
          8[0-79]\d{7,8}|
          [2-79]\d{8}|
          [2-9]\d{7}|
          [3-9]\d{6}|
          [57-9]\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- It might be that lengths 6-8 are local numbers only. Documentation is poor on
           Bangladesh numbers. -->
      <!-- There was a plan to move to 10 digit fixed-line numbers, but this does not seem to have
           been realised, judging by online numbers and wikipedia. These patterns are grouped
           first by leading digit, then within by number of digits. Several Dhaka prefixes(02 731,
           02 890, 02 910, 02 550 etc.) are included despite not being mentioned on Wikipedia /
           ITU due to online evidence. Another oddity is Chittagong - some numbers have a leading
           2, others do not - both are allowed for now. For some area codes, the subscriber number
           length described in our source documentation doesn't match numbers online (e.g. 05222)
           so we allow both for now. (This applies to 0431, 04329, 04623, 05327 as well). We have
           also added 04452 and 04923 from numbers found online. Included prefixes 2778, 2841, 2893,
           2963, 298[59] and 4462 as per user report. 9-digit 24 and 25 prefix numbers were added
           based on user reports, although a doc from BRTC mentions that they are 10-digit numbers,
           which we think might be a typo. -->
      <fixedLine>
        <possibleLengths national="[6-10]"/>
        <exampleNumber>27111234</exampleNumber>
        <nationalNumberPattern>
          (?:
            4(?:
              31\d\d|
              423
            )|
            5222
          )\d{3}(?:
            \d{2}
          )?|
          8332[6-9]\d\d|
          (?:
            3(?:
              03[56]|
              224
            )|
            4(?:
              22[25]|
              653
            )
          )\d{3,4}|
          (?:
            3(?:
              42[47]|
              529|
              823
            )|
            4(?:
              027|
              525|
              65(?:
                28|
                8
              )
            )|
            562|
            6257|
            7(?:
              1(?:
                5[3-5]|
                6[12]|
                7[156]|
                89
              )|
              22[589]56|
              32|
              42675|
              52(?:
                [25689](?:
                  56|
                  8
                )|
                [347]8
              )|
              71(?:
                6[1267]|
                75|
                89
              )|
              92374
            )|
            82(?:
              2[59]|
              32
            )56|
            9(?:
              03[23]56|
              23(?:
                256|
                373
              )|
              31|
              5(?:
                1|
                2[4589]56
              )
            )
          )\d{3}|
          (?:
            3(?:
              02[348]|
              22[35]|
              324|
              422
            )|
            4(?:
              22[67]|
              32[236-9]|
              6(?:
                2[46]|
                5[57]
              )|
              953
            )|
            5526|
            6(?:
              024|
              6655
            )|
            81
          )\d{4,5}|
          (?:
            2(?:
              7(?:
                1[0-267]|
                2[0-289]|
                3[0-29]|
                4[01]|
                5[1-3]|
                6[013]|
                7[0178]|
                91
              )|
              8(?:
                0[125]|
                1[1-6]|
                2[0157-9]|
                3[1-69]|
                41|
                6[1-35]|
                7[1-5]|
                8[1-8]|
                9[0-6]
              )|
              9(?:
                0[0-2]|
                1[0-4]|
                2[568]|
                3[3-6]|
                5[5-7]|
                6[0136-9]|
                7[0-7]|
                8[014-9]
              )
            )|
            3(?:
              0(?:
                2[025-79]|
                3[2-4]
              )|
              181|
              22[12]|
              32[2356]|
              824
            )|
            4(?:
              02[09]|
              22[348]|
              32[045]|
              523|
              6(?:
                27|
                54
              )
            )|
            666(?:
              22|
              53
            )|
            7(?:
              22[57-9]|
              42[56]|
              82[35]
            )8|
            8(?:
              0[124-9]|
              2(?:
                181|
                2[02-4679]8
              )|
              4[12]|
              [5-7]2
            )|
            9(?:
              [04]2|
              2(?:
                2|
                328
              )|
              81
            )
          )\d{4}|
          (?:
            2(?:
              222|
              [45]\d
            )\d|
            3(?:
              1(?:
                2[5-7]|
                [5-7]
              )|
              425|
              822
            )|
            4(?:
              033|
              1\d|
              [257]1|
              332|
              4(?:
                2[246]|
                5[25]
              )|
              6(?:
                2[35]|
                56|
                62
              )|
              8(?:
                23|
                54
              )|
              92[2-5]
            )|
            5(?:
              02[03489]|
              22[457]|
              32[35-79]|
              42[46]|
              6(?:
                [18]|
                53
              )|
              724|
              826
            )|
            6(?:
              023|
              2(?:
                2[2-5]|
                5[3-5]|
                8
              )|
              32[3478]|
              42[34]|
              52[47]|
              6(?:
                [18]|
                6(?:
                  2[34]|
                  5[24]
                )
              )|
              [78]2[2-5]|
              92[2-6]
            )|
            7(?:
              02|
              21\d|
              [3-589]1|
              6[12]|
              72[24]
            )|
            8(?:
              217|
              3[12]|
              [5-7]1
            )|
            9[24]1
          )\d{5}|
          (?:
            (?:
              3[2-8]|
              5[2-57-9]|
              6[03-589]
            )1|
            4[4689][18]
          )\d{5}|
          [59]1\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Presuming that mobile numbers with the prefixes 66, 37, 44 and 38 must be followed by
           numbers [02-9] or they would clash with fixed-line codes. According to the plan, mobile
           numbers should be moving to 1[13-9] anyway. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>1812345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[13-9]\d|
            644
          )\d{7}|
          (?:
            3[78]|
            44|
            66
          )[02-9]\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- Note: Including Tele-voting numbers here as they are free of charge. -->
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>80[03]\d{7}</nationalNumberPattern>
      </tollFree>
      <!-- Prefix 9643 added as per user report. -->
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>9604123456</exampleNumber>
        <nationalNumberPattern>
          96(?:
            0[469]|
            1[0-47]|
            3[389]|
            43|
            6[69]|
            7[78]
          )\d{6}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Belgium (BE) -->
    <!-- http://www.bipt.be/en/operators/telecommunication/Numbering/Database -->
    <!-- http://www.bipt.be/public/files/en/474/20140829153659_Belgian_numbering_plan -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Belgium -->
    <territory id="BE" countryCode="32" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              80|
              9
            )0
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [239]|
            4[23]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[15-8]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>4</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          4\d{8}|
          [1-9]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          80[2-8]\d{5}|
          (?:
            1[0-69]|
            [23][2-8]|
            4[23]|
            5\d|
            6[013-57-9]|
            71|
            8[1-79]|
            9[2-4]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>470123456</exampleNumber>
        <nationalNumberPattern>4[5-9]\d{7}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>800[1-9]\d{4}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            70(?:
              2[0-57]|
              3[04-7]|
              44|
              6[4-69]|
              7[0579]
            )|
            90\d\d
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>78791234</exampleNumber>
        <nationalNumberPattern>7879\d{4}</nationalNumberPattern>
      </sharedCost>
      <!-- 78X numbers are nomadic and standard rate as per voipgate.com and Wikipedia. And these
           are customer care numbers as per online results. Supporting here as UAN is closest
           match. http://www.voipgate.com/site/news/newsflash/new-numbers-available-the-netherlands-and-austria.html -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>78102345</exampleNumber>
        <nationalNumberPattern>
          78(?:
            0[57]|
            1[014-8]|
            2[25]|
            3[15-8]|
            48|
            [56]0|
            7[06-8]|
            9\d
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Burkina Faso (BF) -->
    <!-- http://www.itu.int/oth/T0202000021/en -->
    <!-- http://www.onatel.bf/plan-national-de-numerotation.aspx -->
    <territory id="BF" countryCode="226" internationalPrefix="00">
      <availableFormats>
        <!-- The national numbering plan from ITU suggests grouping of 2, 2 and 4, but we have
             chosen to use the standard from numbers found on the internet instead. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[025-7]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[025-7]\d{7}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>20491234</exampleNumber>
        <nationalNumberPattern>
          2(?:
            0(?:
              49|
              5[23]|
              6[5-7]|
              9[016-9]
            )|
            4(?:
              4[569]|
              5[4-6]|
              6[5-7]|
              7[0179]
            )|
            5(?:
              [34]\d|
              50|
              6[5-7]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>70123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            0[1-35-7]|
            5[0-8]|
            [67]\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Bulgaria (BG) -->
    <!-- http://www.itu.int/oth/T0202000020/en -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Bulgaria -->
    <territory id="BG" countryCode="359" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 6-digit shortcodes. -->
        <numberFormat pattern="(\d{6})">
          <leadingDigits>1</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Formatting rules follow the conventions seen in web-search results. A space has been
             used to separate the area code from the rest of the number, based on sites like
             http://www.goldenpages.bg. -->
        <numberFormat pattern="(\d)(\d)(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            43[1-6]|
            70[1-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [356]|
            4[124-7]|
            7[1-9]|
            8[1-6]|
            9[1-7]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Personal numbers & toll free. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              70|
              8
            )0
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            43[1-7]|
            7
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile and premium rate. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [48]|
            9[08]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          00800\d{7}|
          [2-7]\d{6,7}|
          [89]\d{6,8}|
          2\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- We found evidence at least for ranges 28 and 29 followed by 4 digits in 2016, although
           the latest ITU doc doesn't mention that. -->
      <fixedLine>
        <possibleLengths national="[6-8]" localOnly="4,5"/>
        <exampleNumber>2123456</exampleNumber>
        <nationalNumberPattern>
          2\d{5,7}|
          (?:
            43[1-6]|
            70[1-9]
          )\d{4,5}|
          (?:
            [36]\d|
            4[124-7]|
            [57][1-9]|
            8[1-6]|
            9[1-7]
          )\d{5,6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- The range 99\d{7} is marked as mobile in the ITU doc, but only 996 and 999 seem to be in
           use, the former based on user reports and online numbers, and the latter based on
           wikipedia and information received from MAX telecom. -->
      <mobile>
        <possibleLengths national="8,9"/>
        <exampleNumber>43012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            43[07-9]|
            99[69]\d
          )\d{5}|
          (?:
            8[7-9]|
            98
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8,12"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            00800\d\d|
            800
          )\d{5}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>90\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- Prefix 700 is marked as Personal number in the ITU doc, but as per many websites they
           are shared cost and are charged at a standard price. -->
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>70012345</exampleNumber>
        <nationalNumberPattern>700\d{5}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Bahrain (BH) -->
    <!-- http://www.itu.int/oth/T0202000011/en -->
    <!-- http://www.tra.org.bh/en/marketNumbering.aspx -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Bahrain -->
    <territory id="BH" countryCode="973" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>
            [13679]|
            8[02-4679]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[136-9]\d{7}</nationalNumberPattern>
      </generalDesc>
      <!-- Some ranges were previously described as "universal", but in subsequent versions of the
           ITU doc they have been specified to be mobile or fixed-line. We follow the ITU
           designations, even though some publications still refer to them as universal. -->
      <!-- According to http://en.wikipedia.org/wiki/Telephone_numbers_in_Bahrain, the ranges
           "6966-6969, 6996, 6999" are assigned to Rapid. However this contradicts the ITU doc
           which lists "6966, 6969, 6996, 6999". We follow ITU here. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>17001234</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              3[1356]|
              6[0156]|
              7\d
            )\d|
            6(?:
              1[16]\d|
              500|
              6(?:
                0\d|
                3[12]|
                44|
                55|
                7[7-9]|
                88
              )|
              9[69][69]
            )|
            7(?:
              [07]\d\d|
              1(?:
                11|
                78
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 31 is assigned to Royal Court, as per documents on Bahrain's own telecom site, even
           though it is omitted from the ITU document. Based on online evidences added prefix
           354 to mobile. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>36001234</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              [0-79]\d|
              8[0-57-9]
            )\d|
            6(?:
              3(?:
                00|
                33|
                6[16]
              )|
              441|
              6(?:
                3[03-9]|
                [69]\d|
                7[0-689]
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>8[02369]\d{6}</nationalNumberPattern>
      </tollFree>
      <!-- 87 numbers are "wholly paid by the caller", so they are slotted under premium-rate for
           now. -->
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            87|
            9[0-8]
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>84123456</exampleNumber>
        <nationalNumberPattern>84\d{6}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Burundi (BI) -->
    <!-- http://www.itu.int/oth/T0202000022/en -->
    <territory id="BI" countryCode="257" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[2367]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [267]\d|
            31
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- ITU update 17.IV.2015 assigns 22X completely to Onatel fixed line. Earlier  ITU
           updates (11.IX.2013) were more detailed in that range and only half of it was
           assigned. Erring on the side of ITU and lenience for now, but we may have to make the
           range stricter again. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22201234</exampleNumber>
        <nationalNumberPattern>
          (?:
            22|
            31
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Previous ITU doc (version: 11.IX.2013) says 29 range is assigned to
           "UCOM CDMA network". As there is valid number online continuing support to this range
           eventhough it is not listed in new ITU doc (version: 12.IV.2018). -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>79561234</exampleNumber>
        <nationalNumberPattern>
          (?:
            29|
            [67][125-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Benin (BJ) -->
    <!-- http://www.itu.int/oth/T0202000017/en -->
    <!-- http://arcep.bj/textes-juridiques/nos-decisions/ -->
    <territory id="BJ" countryCode="229" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[24-689]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[24-689]\d{7}</nationalNumberPattern>
      </generalDesc>
      <!-- These come from the national numbering plan, but have been widened to include other
           prefixes found in the yellow pages - specifically 21 0. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>20211234</exampleNumber>
        <nationalNumberPattern>
          2(?:
            02|
            1[037]|
            2[45]|
            3[68]|
            4\d
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- We have restricted the pattern here to the first two digits, as beyond this the data
           seems to be no longer accurate. The latest ITU doc (2005) lists 9[0357] and lists
           other 9x and the complete 6x range as reserved. The prefixes 96 have also been added,
           along with 6[1267] (seemingly prefixes for Mobile MTN). -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>90011234</exampleNumber>
        <nationalNumberPattern>
          (?:
            4[0-7]|
            [56]\d|
            9[013-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>85751234</exampleNumber>
        <nationalNumberPattern>857[58]\d{4}</nationalNumberPattern>
      </voip>
      <!-- Numbers beginning with 81 are reserved for _either_ free phone or shared-cost (same cost
           as a local-call.) We model these as UAN since we have no more detailed information. -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>81123456</exampleNumber>
        <nationalNumberPattern>81\d{6}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- St. Barthélemy (BL) -->
    <!-- Calling code and formatting shared with 'GP' -->
    <!-- There seems to be some overlap with phone numbers from Saint Martin and Guadeloupe. The
         national numbering plan does not specify any St Barthélemy-specific numbering prefixes, but
         it appears from searches in online white and yellow pages that a subset of the prefixes
         available in these regions are used. In these cases, if getRegionCodeForNumber is used, one
         of these region codes will be returned, although numbers will be valid for both regions. -->
    <!-- http://www.itu.int/oth/T0202000058/en -->
    <!-- https://extranet.arcep.fr/portail/Op%C3%A9rateursCE/Num%C3%A9rotation.aspx -->
    <territory id="BL" countryCode="590" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          590\d{6}|
          (?:
            69|
            80|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>590271234</exampleNumber>
        <nationalNumberPattern>
          590(?:
            2[7-9]|
            3[3-7]|
            5[12]|
            87
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Any ranges assigned from
           http://www.arcep.fr/index.php?id=interactivenumeros have been listed as belonging to
           Guadeloupe, St Martin and St Barthélemy, since we can't reliably distinguish between
           them. As per Wikipedia Guadeloupe Téléphone Mobile operator is no longer functioning.
           However we support these ranges as they are still mentioned in ARCEP numbering plan
           doc. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>690001234</exampleNumber>
        <nationalNumberPattern>
          69(?:
            0\d\d|
            1(?:
              2[2-9]|
              3[0-5]
            )|
            4(?:
              0[89]|
              1[2-6]|
              9\d
            )|
            6(?:
              1[016-9]|
              5[0-4]|
              [67]\d
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as Toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>976012345</exampleNumber>
        <nationalNumberPattern>
          9(?:
            (?:
              39[5-7]|
              76[018]
            )\d|
            475[0-5]
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Bermuda (BM) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000018/en -->
    <territory id="BM" countryCode="1" leadingDigits="441" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
               nationalPrefixTransformRule="441$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            441|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>4414123456</exampleNumber>
        <nationalNumberPattern>
          441(?:
            [46]\d\d|
            5(?:
              4\d|
              60|
              89
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>4413701234</exampleNumber>
        <nationalNumberPattern>
          441(?:
            [2378]\d|
            5[0-39]|
            9[02]
          )\d{5}
        </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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Brunei (BN) -->
    <!-- http://www.itu.int/oth/T020200001F/en -->
    <!-- Format is from http://aiti.gov.bn/contact.html -->
    <territory id="BN" countryCode="673" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-578]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-578]\d{6}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2345678</exampleNumber>
        <nationalNumberPattern>
          22[0-7]\d{4}|
          (?:
            2[013-9]|
            [34]\d|
            5[0-25-9]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>7123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            22[89]|
            [78]\d\d
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>5345678</exampleNumber>
        <nationalNumberPattern>5[34]\d{5}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Bolivia (BO) -->
    <!-- http://www.itu.int/oth/T020200001A/en -->
    <!-- http://www.bolivia.com/Servicios/Plandenumeracion.pdf -->
    <territory id="BO" countryCode="591" internationalPrefix="00(?:1\d)?" nationalPrefix="0"
               nationalPrefixForParsing="0(1\d)?">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{7})" carrierCodeFormattingRule="$NP$CC $FG">
          <leadingDigits>
            [23]|
            4[46]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{8})" carrierCodeFormattingRule="$NP$CC $FG">
          <leadingDigits>[67]</leadingDigits>
          <format>$1</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})" carrierCodeFormattingRule="$NP$CC $FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-467]\d\d|
            8001
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="9"/>
        <nationalNumberPattern>8001[07]\d{4}</nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="8" localOnly="7"/>
        <exampleNumber>22123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              2\d\d|
              5(?:
                11|
                [258]\d|
                9[67]
              )|
              6(?:
                12|
                2\d|
                9[34]
              )|
              8(?:
                2[34]|
                39|
                62
              )
            )|
            3(?:
              3\d\d|
              4(?:
                6\d|
                8[24]
              )|
              8(?:
                25|
                42|
                5[257]|
                86|
                9[25]
              )|
              9(?:
                [27]\d|
                3[2-4]|
                4[248]|
                5[24]|
                6[2-6]
              )
            )|
            4(?:
              4\d\d|
              6(?:
                11|
                [24689]\d|
                72
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>71234567</exampleNumber>
        <nationalNumberPattern>[67]\d{7}</nationalNumberPattern>
      </mobile>
      <!-- Added prefix 8001[07] based on user report. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800171234</exampleNumber>
        <nationalNumberPattern>8001[07]\d{4}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Caribbean Netherlands (BQ) -->
    <!-- Calling code and formatting shared with 'CW' -->
    <!-- http://www.itu.int/oth/T02020000F8/en -->
    <territory id="BQ" countryCode="599" leadingDigits="[347]" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [34]1|
            7\d
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Prefixes 72[05] are mentioned as "Long distance service" numbers in ITU. Not supporting
           them for now because we aren't sure what they are used for and no example numbers can
           be found online. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>7151234</exampleNumber>
        <nationalNumberPattern>
          (?:
            318[023]|
            41(?:
              6[023]|
              70
            )|
            7(?:
              1[578]|
              2[05]|
              50
            )\d
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>3181234</exampleNumber>
        <nationalNumberPattern>
          (?:
            31(?:
              8[14-8]|
              9[14578]
            )|
            416[14-9]|
            7(?:
              0[01]|
              7[07]|
              8\d|
              9[056]
            )\d
          )\d{3}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Brazil (BR) -->
    <!-- http://en.wikipedia.org/wiki/%2B55 -->
    <!-- http://www.itu.int/oth/T020200001D/en -->
    <!-- The national prefix for parsing here also contains a capturing group for the main number,
         since the carrier codes here may also be area codes, so we want to check the length of
         the number after capturing. We also need a nationalTransformRule to repopulate with the
         number without the carrier code. -->
    <!-- 90 is an additional dialling token used in place of national prefix (0), under scheme
         "Collect Call" in Brazil. Local dialling under this prefix is not supported.
         https://www.anatel.gov.br/Portal/verificaDocumentos/documento.asp?numeroPublicacao=346146&pub=original&filtro=1&documentoPath=346146.pdf -->
    <territory id="BR" countryCode="55" internationalPrefix="00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)"
               nationalPrefix="0"
               nationalPrefixForParsing="
                 (?:
                   0|
                   90
                 )(?:
                   (
                     1[245]|
                     2[1-35]|
                     31|
                     4[13]|
                     [56]5|
                     99
                   )(
                     \d{10,11}
                   )
                 )?"
               nationalPrefixTransformRule="$2" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Format short numbers as a block. -->
        <numberFormat pattern="(\d{3,6})">
          <leadingDigits>
            1(?:
              1[25-8]|
              2[357-9]|
              3[02-68]|
              4[12568]|
              5|
              6[0-8]|
              8[015]|
              9[0-47-9]
            )|
            321|
            610
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 8-digit shared cost numbers (mostly national only). -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>
            300|
            4(?:
              0[02]|
              37
            )
          </leadingDigits>
          <leadingDigits>
            4(?:
              02|
              37
            )0|
            [34]00
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[2-57]</leadingDigits>
          <leadingDigits>
            [2357]|
            4(?:
              [0-24-9]|
              3(?:
                [0-689]|
                7[1-9]
              )
            )
          </leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Variable cost numbers (9 - 10 digits). -->
        <numberFormat pattern="(\d{3})(\d{2,3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              [358]|
              90
            )0
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{5})(\d{4})">
          <leadingDigits>9</leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Fixed-line and pre-transition mobile numbers and mobile radio services dialled with an
             area code. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="($FG)"
                      carrierCodeFormattingRule="$NP $CC ($FG)">
          <leadingDigits>
            (?:
              [14689][1-9]|
              2[12478]|
              3[1-578]|
              5[13-5]|
              7[13-579]
            )[2-57]
          </leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <!-- Mobile numbers (post transition, 11 digits). -->
        <numberFormat pattern="(\d{2})(\d{5})(\d{4})" nationalPrefixFormattingRule="($FG)"
                      carrierCodeFormattingRule="$NP $CC ($FG)">
          <leadingDigits>
            [16][1-9]|
            [2-57-9]
          </leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [1-46-9]\d\d|
            5(?:
              [0-46-9]\d|
              5[0-46-9]
            )
          )\d{8}|
          [1-9]\d{9}|
          [3589]\d{8}|
          [34]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="[8-10]"/>
        <nationalNumberPattern>
          30(?:
            0\d{5,7}|
            3\d{7}
          )|
          40(?:
            0\d|
            20
          )\d{4}|
          800\d{6,7}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- 52 is not added as an area code even though ITU mentions it, since it is not yet
           assigned as per ANATEL and Wikipedia. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="8"/>
        <exampleNumber>1123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            [14689][1-9]|
            2[12478]|
            3[1-578]|
            5[13-5]|
            7[13-579]
          )[2-5]\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Mobile radio services were not migrated and remain 10 digits long, where the 3rd digit is
           7.  -->
      <!-- 52 is not included as a valid area code even though ITU mentions it, since it is not
           assigned as per ANATEL and Wikipedia. -->
      <mobile>
        <possibleLengths national="10,11" localOnly="8,9"/>
        <exampleNumber>11961234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            [14689][1-9]|
            2[12478]|
            3[1-578]|
            5[13-5]|
            7[13-579]
          )(?:
            7|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9,10"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6,7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9,10"/>
        <exampleNumber>300123456</exampleNumber>
        <nationalNumberPattern>
          300\d{6}|
          [59]00\d{6,7}
        </nationalNumberPattern>
      </premiumRate>
      <!-- Supported 4370 as shared cost based on user report. -->
      <sharedCost>
        <possibleLengths national="8,10"/>
        <exampleNumber>40041234</exampleNumber>
        <nationalNumberPattern>
          (?:
            30[03]\d{3}|
            4(?:
              0(?:
                0\d|
                20
              )|
              370
            )
          )\d{4}|
          300\d{5}
        </nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Bahamas (BS) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000010/en -->
    <territory id="BS" countryCode="1" leadingDigits="242" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([3-8]\d{6})$|1"
               nationalPrefixTransformRule="242$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            242|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2423456789</exampleNumber>
        <nationalNumberPattern>
          242(?:
            3(?:
              02|
              [236][1-9]|
              4[0-24-9]|
              5[0-68]|
              7[347]|
              8[0-4]|
              9[2-467]
            )|
            461|
            502|
            6(?:
              0[1-5]|
              12|
              2[013]|
              [45]0|
              7[67]|
              8[78]|
              9[89]
            )|
            7(?:
              02|
              88
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2423591234</exampleNumber>
        <nationalNumberPattern>
          242(?:
            3(?:
              5[79]|
              7[56]|
              95
            )|
            4(?:
              [23][1-9]|
              4[1-35-9]|
              5[1-8]|
              6[2-8]|
              7\d|
              81
            )|
            5(?:
              2[45]|
              3[35]|
              44|
              5[1-46-9]|
              65|
              77
            )|
            6[34]6|
            7(?:
              27|
              38
            )|
            8(?:
              0[1-9]|
              1[02-9]|
              2\d|
              3[0-4]|
              [89]9
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- 242 300 is a Domestic Toll Free service. -->
      <tollFree>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8002123456</exampleNumber>
        <nationalNumberPattern>
          242300\d{4}|
          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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <!-- 225[0-46-9] ranges are mentioned as DID (Direct Inward Dialing) numbers in ITU doc.
           http://whatis.techtarget.com/definition/Direct-Inward-Dialing-DID. Found valid numbers
           online. -->
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>2422250123</exampleNumber>
        <nationalNumberPattern>242225\d{4}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Bhutan (BT) -->
    <!-- Universal personal telecommunication prefixes 700 and 878 are not
         added as there is no information on length of numbers. -->
    <!-- Pager service prefix 91 is not added as there is no information on
         length of numbers. -->
    <!-- http://www.itu.int/oth/T0202000019/en -->
    <territory id="BT" countryCode="975" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>[2-7]</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3})">
          <leadingDigits>
            [2-68]|
            7[246]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format is from
             http://www.tourism.gov.bt/tour-operators/bhutan-abbot-tours-and-travels.html -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            1[67]|
            7
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [17]\d{7}|
          [2-8]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7" localOnly="6"/>
        <exampleNumber>2345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[3-6]|
            [34][5-7]|
            5[236]|
            6[2-46]|
            7[246]|
            8[2-4]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>17123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[67]|
            77
          )\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Botswana (BW) -->
    <!-- http://www.itu.int/oth/T020200001C/en -->
    <territory id="BW" countryCode="267" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{5})">
          <leadingDigits>90</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            [24-6]|
            3[15-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
          <leadingDigits>[37]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})(\d{3})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            0800|
            (?:
              [37]|
              800
            )\d
          )\d{6}|
          (?:
            [2-6]\d|
            90
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Number range 373 is been supported based on user report and online evidence. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2401234</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              4[0-48]|
              6[0-24]|
              9[0578]
            )|
            3(?:
              1[0-35-9]|
              55|
              [69]\d|
              7[013]|
              81
            )|
            4(?:
              6[03]|
              7[1267]|
              9[0-5]
            )|
            5(?:
              3[03489]|
              4[0489]|
              7[1-47]|
              88|
              9[0-49]
            )|
            6(?:
              2[1-35]|
              5[149]|
              8[067]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added prefixes 748, 749, 778 after getting confirmation from the carriers who
           own them. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>71123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            321|
            7[1-8]\d
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- BOCRA (official authority) and many Government websites mention 0800 XXX XXX range. -->
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>0800012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            0800|
            800\d
          )\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>9012345</exampleNumber>
        <nationalNumberPattern>90\d{5}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>79101234</exampleNumber>
        <nationalNumberPattern>
          79(?:
            1(?:
              [01]\d|
              2[0-8]
            )|
            2[0-7]\d
          )\d{3}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Belarus (BY) -->
    <!-- Information on national prefix provided by a Belarussian person. -->
    <!-- http://www.eng.beltelecom.by/en/subscribers/phone-codes -->
    <territory id="BY" countryCode="375" preferredInternationalPrefix="8~10"
               internationalPrefix="810" nationalPrefix="8" nationalPrefixForParsing="0|80?"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 6 digit toll-free numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>800</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 7-9 digit toll-free numbers. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2,4})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>800</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 4 digit area codes (fixed line only). -->
        <numberFormat pattern="(\d{4})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP 0$FG">
          <leadingDigits>
            1(?:
              5[169]|
              6[3-5]|
              7[179]
            )|
            2(?:
              1[35]|
              2[34]|
              3[3-5]
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              5[169]|
              6(?:
                3[1-3]|
                4|
                5[125]
              )|
              7(?:
                1[3-9]|
                7[0-24-6]|
                9[2-7]
              )
            )|
            2(?:
              1[35]|
              2[34]|
              3[3-5]
            )
          </leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <!-- 3 digit area codes (fixed line only). -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP 0$FG">
          <leadingDigits>
            1(?:
              [56]|
              7[467]
            )|
            2[1-3]
          </leadingDigits>
          <format>$1 $2-$3-$4</format>
        </numberFormat>
        <!-- 2 digit "area codes" (mostly mobile, but some fixed line ranges). -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP 0$FG">
          <leadingDigits>[1-4]</leadingDigits>
          <format>$1 $2-$3-$4</format>
        </numberFormat>
        <!-- 10-11 digit toll-free / premium rate numbers. -->
        <numberFormat pattern="(\d{3})(\d{3,4})(\d{4})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [12]\d|
            33|
            44|
            902
          )\d{7}|
          8(?:
            0[0-79]\d{5,7}|
            [1-7]\d{9}
          )|
          8(?:
            1[0-489]|
            [5-79]\d
          )\d{7}|
          8[1-79]\d{6,7}|
          8[0-79]\d{5}|
          8\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Toll-free and premium rate numbers are not available from abroad. -->
      <noInternationalDialling>
        <possibleLengths national="[6-11]"/>
        <nationalNumberPattern>
          800\d{3,7}|
          (?:
            8(?:
              0[13]|
              10|
              20\d
            )|
            902
          )\d{7}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- Using test number for Grodno from the plan. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="[5-7]"/>
        <exampleNumber>152450911</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              5(?:
                1[1-5]|
                [24]\d|
                6[2-4]|
                9[1-7]
              )|
              6(?:
                [235]\d|
                4[1-7]
              )|
              7\d\d
            )|
            2(?:
              1(?:
                [246]\d|
                3[0-35-9]|
                5[1-9]
              )|
              2(?:
                [235]\d|
                4[0-8]
              )|
              3(?:
                [26]\d|
                3[02-79]|
                4[024-7]|
                5[03-7]
              )
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Using test number for BelCel from the plan. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>294911911</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              5[5-79]|
              9[1-9]
            )|
            (?:
              33|
              44
            )\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Putting Interactive Polling Service (free) here too. -->
      <tollFree>
        <possibleLengths national="[6-11]"/>
        <exampleNumber>8011234567</exampleNumber>
        <nationalNumberPattern>
          800\d{3,7}|
          8(?:
            0[13]|
            20\d
          )\d{7}
        </nationalNumberPattern>
      </tollFree>
      <!-- Putting Interactive Polling Service (paid) here too. -->
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9021234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            810|
            902
          )\d{7}
        </nationalNumberPattern>
      </premiumRate>
      <!-- 249 prefix for Beltelcom's Maxiphone added based on online info. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>249123456</exampleNumber>
        <nationalNumberPattern>249\d{6}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Belize (BZ) -->
    <!-- The trunk prefix, formally 0, was dropped in the last reorganisation of the numbering plan. -->
    <!-- http://www.itu.int/oth/T0202000016/en -->
    <territory id="BZ" countryCode="501" internationalPrefix="00">
      <availableFormats>
        <!-- Adding hyphen following the Belize Telemedia formatting rules. -->
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-8]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4})(\d{3})">
          <leadingDigits>0</leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            0800\d|
            [2-8]
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Wikipedia and ITU seem out of date, but say that for a number in the format ZNY-XXXX
           Z represents the district code (or 6 for mobile), N the type of number and Y the first
           digit of the customer's number. Only N = 0 and 2 are supposedly in use, but we have
           found some numbers with N = 3 online (prefixes 732 and 236). When emailed,
           Belize Telemedia Ltd confirmed numbers with prefix 732 belong to the Landline Postpaid
           PSTN category. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2221234</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              [02]\d|
              36|
              [68]0
            )|
            [3-58](?:
              [02]\d|
              [68]0
            )|
            7(?:
              [02]\d|
              32|
              [68]0
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 62[6-9], 63X, 65X and 6[67][2-9] were added as we have been able to successfully
           send SMSs to these numbers or many numbers have been found online. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>6221234</exampleNumber>
        <nationalNumberPattern>6[0-35-7]\d{5}</nationalNumberPattern>
      </mobile>
      <!-- We don't know how these would be dialled internationally - it is possible that they can't
           be dialled internationally at all - so we represent the leading 0 as part of the number.
           Information from http://www.belizetelemedia.net. -->
      <tollFree>
        <possibleLengths national="11"/>
        <exampleNumber>08001234123</exampleNumber>
        <nationalNumberPattern>0800\d{7}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Canada (CA) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.cnac.ca/canadian_dial_plan/canadian_dial_plan.htm -->
    <territory id="CA" countryCode="1" internationalPrefix="011" nationalPrefix="1"
               mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-8]\d|
            90
          )\d{8}|
          3\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>5062345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              04|
              [23]6|
              [48]9|
              50|
              63
            )|
            3(?:
              06|
              43|
              54|
              6[578]|
              82
            )|
            4(?:
              03|
              1[68]|
              [26]8|
              3[178]|
              50|
              74
            )|
            5(?:
              06|
              1[49]|
              48|
              79|
              8[147]
            )|
            6(?:
              04|
              [18]3|
              39|
              47|
              72
            )|
            7(?:
              0[59]|
              42|
              53|
              78|
              8[02]
            )|
            8(?:
              [06]7|
              19|
              25|
              73
            )|
            90[25]
          )[2-9]\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>5062345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              04|
              [23]6|
              [48]9|
              50|
              63
            )|
            3(?:
              06|
              43|
              54|
              6[578]|
              82
            )|
            4(?:
              03|
              1[68]|
              [26]8|
              3[178]|
              50|
              74
            )|
            5(?:
              06|
              1[49]|
              48|
              79|
              8[147]
            )|
            6(?:
              04|
              [18]3|
              39|
              47|
              72
            )|
            7(?:
              0[59]|
              42|
              53|
              78|
              8[02]
            )|
            8(?:
              [06]7|
              19|
              25|
              73
            )|
            90[25]
          )[2-9]\d{6}
        </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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          (?:
            5(?:
              00|
              2[125-9]|
              33|
              44|
              66|
              77|
              88
            )|
            622
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <!-- 600 (Canadian Non-Geographic Tariffed Services) are satellite numbers as per Wikipedia:
           https://en.wikipedia.org/wiki/Area_code_600 -->
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>6002012345</exampleNumber>
        <nationalNumberPattern>600[2-9]\d{6}</nationalNumberPattern>
      </voip>
      <!-- Prefix 310 (7 digit) is added based on user report and online documents. -->
      <uan>
        <possibleLengths national="7"/>
        <exampleNumber>3101234</exampleNumber>
        <nationalNumberPattern>310\d{4}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Cocos (Keeling) Islands (CC) -->
    <!-- Calling code and formatting shared with 'AU' -->
    <!-- References state Cocos Islands have fixed line numbers starting +61 8 9162. -->
    <!-- http://en.wikipedia.org/wiki/List_of_country_calling_codes -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Australia -->
    <!-- https://www.thenumberingsystem.com.au/#/number-register/search -->
    <territory id="CC" countryCode="61" preferredInternationalPrefix="0011"
               internationalPrefix="001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011"
               nationalPrefix="0" nationalPrefixForParsing="([59]\d{7})$|0"
               nationalPrefixTransformRule="8$1">
      <generalDesc>
        <nationalNumberPattern>
          1(?:
            [0-79]\d{8}(?:
              \d{2}
            )?|
            8[0-24-9]\d{7}
          )|
          [148]\d{8}|
          1\d{5,7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9" localOnly="8"/>
        <exampleNumber>891621234</exampleNumber>
        <nationalNumberPattern>
          8(?:
            51(?:
              0(?:
                02|
                31|
                60|
                89
              )|
              1(?:
                18|
                76
              )|
              223
            )|
            91(?:
              0(?:
                1[0-2]|
                29
              )|
              1(?:
                [28]2|
                50|
                79
              )|
              2(?:
                10|
                64
              )|
              3(?:
                [06]8|
                22
              )|
              4[29]8|
              62\d|
              70[23]|
              959
            )
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Mobile, toll free, premium rate and VOIP copied from Australia. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>412345678</exampleNumber>
        <nationalNumberPattern>
          4(?:
            (?:
              79|
              94
            )[01]|
            83[0-389]
          )\d{5}|
          4(?:
            [0-3]\d|
            4[047-9]|
            5[0-25-9]|
            6[0-36-9]|
            7[02-8]|
            8[0-24-9]|
            9[0-37-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7,10"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          180(?:
            0\d{3}|
            2
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>1900123456</exampleNumber>
        <nationalNumberPattern>190[0-26]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- Local-rate (SmartNumbers) are put here because they are a reverse-charge network,
           although they charge a small local call connect fee (around 25c). These start with 13
           or 1300. -->
      <sharedCost>
        <possibleLengths national="6,8,10,12"/>
        <exampleNumber>1300123456</exampleNumber>
        <nationalNumberPattern>
          13(?:
            00\d{6}(?:
              \d{2}
            )?|
            45[0-4]\d{3}
          )|
          13\d{4}
        </nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>147101234</exampleNumber>
        <nationalNumberPattern>
          14(?:
            5(?:
              1[0458]|
              [23][458]
            )|
            71\d
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Congo - Kinshasa (CD) -->
    <!-- http://www.itu.int/oth/T0202000037/en -->
    <territory id="CD" countryCode="243" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>88</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-6]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [189]\d{8}|
          [1-68]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7,9"/>
        <exampleNumber>1234567</exampleNumber>
        <nationalNumberPattern>
          12\d{7}|
          [1-6]\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- As of May'13 the 88 range looks as if it is defunct. The ITU document lists "Yozma
           Timeturns" as the operator, but their website (http://www.ytt.cd) is offline and the
           holdings company http://www.timeturnsholdings.com/products does not show a link for
           DRC. While there are still numbers of the form "88\d{5}" online, none of the ones
           tried were valid. If the holdings company does not respond to requests about this
           range and unless we receive further information, we will remove this range. -->
      <mobile>
        <possibleLengths national="7,9"/>
        <exampleNumber>991234567</exampleNumber>
        <nationalNumberPattern>
          88\d{5}|
          (?:
            8[0-59]|
            9[017-9]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Central African Republic (CF) -->
    <!-- http://www.itu.int/oth/T0202000028/en -->
    <territory id="CF" countryCode="236" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[278]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [27]\d{3}|
            8776
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21612345</exampleNumber>
        <nationalNumberPattern>2[12]\d{6}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>70012345</exampleNumber>
        <nationalNumberPattern>7[024-7]\d{6}</nationalNumberPattern>
      </mobile>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>87761234</exampleNumber>
        <nationalNumberPattern>8776\d{4}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Congo - Brazzaville (CG) -->
    <!-- http://www.itu.int/oth/T020200002E/en -->
    <territory id="CG" countryCode="242" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>[02]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          222\d{6}|
          (?:
            0\d|
            80
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>222123456</exampleNumber>
        <nationalNumberPattern>222[1-589]\d{5}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>061234567</exampleNumber>
        <nationalNumberPattern>
          026(?:
            1[0-5]|
            6[6-9]
          )\d{4}|
          0(?:
            [14-6]\d\d|
            2(?:
              40|
              5[5-8]|
              6[07-9]
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Referred to as a "Green number" in the telephone plan. -->
      <!-- Using this to represent Value Added Service in the plan. -->
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>80[0-2]\d{6}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Switzerland (CH) -->
    <!-- Under Technical prescriptions: Numbering plan for international carriers. -->
    <!-- http://www.bakom.admin.ch/themen/telekom/00479/00604/index.html?lang=en -->
    <territory id="CH" countryCode="41" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            8[047]|
            90
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [2-79]|
            81
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})(\d{2})(\d{2})"
                      nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          8\d{11}|
          [2-9]\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>212345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[12467]|
            3[1-4]|
            4[134]|
            5[256]|
            6[12]|
            [7-9]1
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>781234567</exampleNumber>
        <nationalNumberPattern>7[35-9]\d{7}</nationalNumberPattern>
      </mobile>
      <!-- https://www.eofcom.admin.ch/eofcom/public/listEofcom_e164Allocated.do -->
      <pager>
        <possibleLengths national="9"/>
        <exampleNumber>740123456</exampleNumber>
        <nationalNumberPattern>74[0248]\d{6}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>90[016]\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>840123456</exampleNumber>
        <nationalNumberPattern>84[0248]\d{6}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>878123456</exampleNumber>
        <nationalNumberPattern>878\d{6}</nationalNumberPattern>
      </personalNumber>
      <!-- Used for corporate networks. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>581234567</exampleNumber>
        <nationalNumberPattern>5[18]\d{7}</nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="12"/>
        <exampleNumber>860123456789</exampleNumber>
        <nationalNumberPattern>860\d{9}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Côte d’Ivoire (CI) -->
    <!-- http://www.itu.int/oth/T0202000031/en -->
    <!-- http://fr.wikipedia.org/wiki/Liste_des_indicatifs_téléphoniques_en_Côte_d’Ivoire -->
    <territory id="CI" countryCode="225" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d)(\d{5})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[02]\d{9}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10"/>
        <exampleNumber>2123456789</exampleNumber>
        <nationalNumberPattern>
          2(?:
            [15]\d{3}|
            7(?:
              2(?:
                0[23]|
                1[2357]|
                2[245]|
                3[45]|
                4[3-5]
              )|
              3(?:
                06|
                1[69]|
                [2-6]7
              )
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added the prefixes 4[0-2] (Moov), 5[7-9] and 61 because SMS messages have been
           successfully delivered. Supported by numbers found on the internet. Also added 43
           (Moov) based on numbers found online. Added 8[456] MTN ranges based on Wikipedia page.
           50 has been removed since Warid seems to have stopped operation in Côte d'Ivoire.
           Prefix 73 and 97[0-3] are added based on user reports. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>0123456789</exampleNumber>
        <nationalNumberPattern>0[157]\d{8}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Cook Islands (CK) -->
    <!-- http://www.itu.int/oth/T020200002F/en -->
    <territory id="CK" countryCode="682" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})">
          <leadingDigits>[2-578]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-578]\d{4}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="5"/>
        <exampleNumber>21234</exampleNumber>
        <nationalNumberPattern>
          (?:
            2\d|
            3[13-7]|
            4[1-5]
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="5"/>
        <exampleNumber>71234</exampleNumber>
        <nationalNumberPattern>[578]\d{4}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Chile (CL) -->
    <!-- As per ITU doc, from 5 Sep 2016, fixed-mobile portability will apply in Chile. So same
         nationalNumberPatterns are maintained in both fixed-line and mobile categories. -->
    <!-- According to subtel.gob.cl as of August 2014, nationalPrefix(0) and carrier codes are not
         required to make a call between fixed-line and mobile in Chile. -->
    <!-- http://www.itu.int/oth/T020200002A/en -->
    <!-- http://en.wikipedia.org/wiki/%2B56 -->
    <!-- http://www.subtel.gob.cl/base_numeracion/tabla_numeracion_ido_idd.xlsx -->
    <!-- When dialling mobile numbers from landlines, or vice versa, you need a prefix of 0, which
         we strip here. National destinations may be dialled with a carrier if they are not local
         so we extract these carrier codes as well. -->
    <territory id="CL" countryCode="56"
               internationalPrefix="(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Formats four digit 1X short numbers as a block. We are not formatting other 4 and 5
             digit short codes as block because those prefixes overlap with phone numbers and
             including them suppresses the AYTF of overlapping prefix phone numbers. -->
        <numberFormat pattern="(\d{4})">
          <leadingDigits>
            1(?:
              [03-589]|
              21
            )|
            [29]0|
            78
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- For only 219X prefix used rurally by CTR. -->
        <numberFormat pattern="(\d{5})(\d{4})" nationalPrefixFormattingRule="($FG)">
          <leadingDigits>219</leadingDigits>
          <leadingDigits>2196</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Format for VOIP numbers. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>44</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for 2X fixed-line numbers. Note that due to fixed-mobile portability same
             ranges are maintained in both fixed-line and mobile categories. Formats are based
             on original phone number type. -->
        <numberFormat pattern="(\d)(\d{4})(\d{4})" nationalPrefixFormattingRule="($FG)">
          <leadingDigits>2[1-36]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for mobile numbers. -->
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <leadingDigits>9[2-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for all other fixed-line numbers. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="($FG)">
          <leadingDigits>
            3[2-5]|
            [47]|
            5[1-3578]|
            6[13-57]|
            8(?:
              0[1-9]|
              [1-9]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for variable cost numbers like toll-free, shared cost. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})">
          <leadingDigits>
            60|
            8
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 11 digit toll-free numbers. -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 11 digit shared cost numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{3})">
          <leadingDigits>60</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          12300\d{6}|
          6\d{9,10}|
          [2-9]\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="10,11"/>
        <nationalNumberPattern>600\d{7,8}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- Area codes do not need to be dialled when dialling within the same area, so the
           smallest possible number is length 7. -->
      <!-- Local-only calls are no longer valid and it is mandated to use area codes while calling
           between different regions. -->
      <!-- In mid-2013, Chile switched from 8 digits to 9 digits for fixed-line numbers, by
           inserting a '2' after the area code (which are 2 digits, with the exception of '2').
           As of Aug. 2014, all of the prefixes have been switched over to the new plan.
           IMPORTANT: Originally after the change Santiago numbers had a prefix of "22", but
           already numbers with the prefix "23" are being added.
           See: http://www.gob.cl/especiales/informate-de-la-nueva-forma-de-marcar/
                http://www.subtel.cl/index.php?option=com_content&view=article&id=3081:&catid=3:noticias
           Added 232[3-8] ranges based on online evidence. -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>221234567</exampleNumber>
        <nationalNumberPattern>
          2(?:
            1982[0-6]|
            3314[05-9]
          )\d{3}|
          (?:
            2(?:
              1(?:
                160|
                962
              )|
              3(?:
                2\d\d|
                3(?:
                  [03467]\d|
                  1[0-35-9]|
                  2[1-9]|
                  5[0-24-9]|
                  8[0-3]
                )|
                600
              )|
              646[59]
            )|
            80[1-9]\d\d|
            9(?:
              3(?:
                [0-57-9]\d\d|
                6(?:
                  0[02-9]|
                  [1-9]\d
                )
              )|
              6(?:
                [0-8]\d\d|
                9(?:
                  [02-79]\d|
                  1[05-9]
                )
              )|
              7[1-9]\d\d|
              9(?:
                [03-9]\d\d|
                1(?:
                  [0235-9]\d|
                  4[0-24-9]
                )|
                2(?:
                  [0-79]\d|
                  8[0-46-9]
                )
              )
            )
          )\d{4}|
          (?:
            22|
            3[2-5]|
            [47][1-35]|
            5[1-3578]|
            6[13-57]|
            8[1-9]|
            9[2458]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Supported 9[23] mobile ranges as per user report. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>221234567</exampleNumber>
        <nationalNumberPattern>
          2(?:
            1982[0-6]|
            3314[05-9]
          )\d{3}|
          (?:
            2(?:
              1(?:
                160|
                962
              )|
              3(?:
                2\d\d|
                3(?:
                  [03467]\d|
                  1[0-35-9]|
                  2[1-9]|
                  5[0-24-9]|
                  8[0-3]
                )|
                600
              )|
              646[59]
            )|
            80[1-9]\d\d|
            9(?:
              3(?:
                [0-57-9]\d\d|
                6(?:
                  0[02-9]|
                  [1-9]\d
                )
              )|
              6(?:
                [0-8]\d\d|
                9(?:
                  [02-79]\d|
                  1[05-9]
                )
              )|
              7[1-9]\d\d|
              9(?:
                [03-9]\d\d|
                1(?:
                  [0235-9]\d|
                  4[0-24-9]
                )|
                2(?:
                  [0-79]\d|
                  8[0-46-9]
                )
              )
            )
          )\d{4}|
          (?:
            22|
            3[2-5]|
            [47][1-35]|
            5[1-3578]|
            6[13-57]|
            8[1-9]|
            9[2458]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- Toll free patterns have been collected by looking at numbers on the internet, rather than
           from a definitive source. -->
      <!-- 1230 numbers are used by Visa/Mastercard helplines in Chile -->
      <tollFree>
        <possibleLengths national="9,11"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            123|
            8
          )00\d{6}
        </nationalNumberPattern>
      </tollFree>
      <!-- http://empresa.movistar.cl/nuestros_productos/soluciones_telefonia_ip/servicios/servicio_600.php -->
      <sharedCost>
        <possibleLengths national="10,11"/>
        <exampleNumber>6001234567</exampleNumber>
        <nationalNumberPattern>600\d{7,8}</nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>441234567</exampleNumber>
        <nationalNumberPattern>44\d{7}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Cameroon (CM) -->
    <!-- http://www.itu.int/oth/T0202000024/en -->
    <!-- http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-OB.1063-2014-OAS-PDF-E.pdf -->
    <territory id="CM" countryCode="237" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>88</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Formatting in the ITU update document aligns with formatting online (all 2 digit
             groups). For the new number format with 9 digits the first digit has it's own group. -->
        <numberFormat pattern="(\d)(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            [26]|
            88
          </leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [26]\d{8}|
          88\d{6,7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- CDMA numbers are described in a subcategory to fixed line numbers in the ITU update
           document, so those prefixes are added to fixed line (24[23]). -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>222123456</exampleNumber>
        <nationalNumberPattern>
          2(?:
            22|
            33
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 68 was added based on info found online. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>671234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            24[23]|
            6[25-9]\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Numbers starting with 8 are listed as value-added in the ITU doc, but only numbers
           starting with 88 have been found online. These are all listed as being "numéro vert",
           "ligne verte" or "gratuit" (free). -->
      <tollFree>
        <possibleLengths national="8,9"/>
        <exampleNumber>88012345</exampleNumber>
        <nationalNumberPattern>88\d{6,7}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- China (CN) -->
    <!-- The international/national prefix patterns must not collide with valid prefixes such
         as 17[0678] and 19[89]. 179XX00 is a valid calling prefix, see: www.chahaoba.com/179 -->
    <!-- http://www.itu.int/oth/T020200002B/en -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_China -->
    <territory id="CN" countryCode="86" preferredInternationalPrefix="00"
               internationalPrefix="00|1(?:[12]\d|79)\d\d00" nationalPrefix="0"
               nationalPrefixForParsing="(1(?:[12]\d|79)\d\d)|0">
      <availableFormats>
        <numberFormat pattern="(\d{5,6})">
          <leadingDigits>
            10|
            96
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 100xx and 9[56]xxx(x) numbers with two-digit area codes. -->
        <numberFormat pattern="(\d{2})(\d{5,6})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            (?:
              10|
              2[0-57-9]
            )[19]
          </leadingDigits>
          <leadingDigits>
            (?:
              10|
              2[0-57-9]
            )(?:
              10|
              9[56]
            )
          </leadingDigits>
          <leadingDigits>
            10(?:
              10|
              9[56]
            )|
            2[0-57-9](?:
              100|
              9[56]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[1-9]</leadingDigits>
          <leadingDigits>
            1[1-9]|
            26|
            [3-9]|
            (?:
              10|
              2[0-57-9]
            )(?:
              [0-8]|
              9[0-47-9]
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              0(?:
                [0-8]|
                9[0-47-9]
              )|
              [1-9]
            )|
            2(?:
              [0-57-9](?:
                [02-8]|
                1(?:
                  0[1-9]|
                  [1-9]
                )|
                9[0-47-9]
              )|
              6
            )|
            [3-9]
          </leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 8-digit premium rate numbers. -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>16[08]</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 100xx and 9[56]xxx(x) numbers with three-digit area codes. -->
        <numberFormat pattern="(\d{3})(\d{5,6})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            3(?:
              [157]|
              35|
              49|
              9[1-68]
            )|
            4(?:
              [17]|
              2[179]|
              6[47-9]|
              8[23]
            )|
            5(?:
              [1357]|
              2[37]|
              4[36]|
              6[1-46]|
              80
            )|
            6(?:
              3[1-5]|
              6[0238]|
              9[12]
            )|
            7(?:
              01|
              [1579]|
              2[248]|
              3[014-9]|
              4[3-6]|
              6[023689]
            )|
            8(?:
              1[236-8]|
              2[5-7]|
              [37]|
              8[36-8]|
              9[1-8]
            )|
            9(?:
              0[1-3689]|
              1[1-79]|
              [379]|
              4[13]|
              5[1-5]
            )|
            (?:
              4[35]|
              59|
              85
            )[1-9]
          </leadingDigits>
          <leadingDigits>
            (?:
              3(?:
                [157]\d|
                35|
                49|
                9[1-68]
              )|
              4(?:
                [17]\d|
                2[179]|
                [35][1-9]|
                6[47-9]|
                8[23]
              )|
              5(?:
                [1357]\d|
                2[37]|
                4[36]|
                6[1-46]|
                80|
                9[1-9]
              )|
              6(?:
                3[1-5]|
                6[0238]|
                9[12]
              )|
              7(?:
                01|
                [1579]\d|
                2[248]|
                3[014-9]|
                4[3-6]|
                6[023689]
              )|
              8(?:
                1[236-8]|
                2[5-7]|
                [37]\d|
                5[1-9]|
                8[36-8]|
                9[1-8]
              )|
              9(?:
                0[1-3689]|
                1[1-79]|
                [379]\d|
                4[13]|
                5[1-5]
              )
            )[19]
          </leadingDigits>
          <leadingDigits>
            85[23](?:
              10|
              95
            )|
            (?:
              3(?:
                [157]\d|
                35|
                49|
                9[1-68]
              )|
              4(?:
                [17]\d|
                2[179]|
                [35][1-9]|
                6[47-9]|
                8[23]
              )|
              5(?:
                [1357]\d|
                2[37]|
                4[36]|
                6[1-46]|
                80|
                9[1-9]
              )|
              6(?:
                3[1-5]|
                6[0238]|
                9[12]
              )|
              7(?:
                01|
                [1579]\d|
                2[248]|
                3[014-9]|
                4[3-6]|
                6[023689]
              )|
              8(?:
                1[236-8]|
                2[5-7]|
                [37]\d|
                5[14-9]|
                8[36-8]|
                9[1-8]
              )|
              9(?:
                0[1-3689]|
                1[1-79]|
                [379]\d|
                4[13]|
                5[1-5]
              )
            )(?:
              10|
              9[56]
            )
          </leadingDigits>
          <leadingDigits>
            85[23](?:
              100|
              95
            )|
            (?:
              3(?:
                [157]\d|
                35|
                49|
                9[1-68]
              )|
              4(?:
                [17]\d|
                2[179]|
                [35][1-9]|
                6[47-9]|
                8[23]
              )|
              5(?:
                [1357]\d|
                2[37]|
                4[36]|
                6[1-46]|
                80|
                9[1-9]
              )|
              6(?:
                3[1-5]|
                6[0238]|
                9[12]
              )|
              7(?:
                01|
                [1579]\d|
                2[248]|
                3[014-9]|
                4[3-6]|
                6[023689]
              )|
              8(?:
                1[236-8]|
                2[5-7]|
                [37]\d|
                5[14-9]|
                8[36-8]|
                9[1-8]
              )|
              9(?:
                0[1-3689]|
                1[1-79]|
                [379]\d|
                4[13]|
                5[1-5]
              )
            )(?:
              100|
              9[56]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[1-9]</leadingDigits>
          <leadingDigits>
            1(?:
              0(?:
                [02-8]|
                1[1-9]|
                9[0-47-9]
              )|
              [1-9]
            )|
            2(?:
              [0-57-9](?:
                [0-8]|
                9[0-47-9]
              )|
              6
            )|
            [3-9]
          </leadingDigits>
          <leadingDigits>
            1(?:
              0(?:
                [02-8]|
                1[1-9]|
                9[0-47-9]
              )|
              [1-9]
            )|
            26|
            3(?:
              [0268]|
              4[0-8]|
              9[079]
            )|
            4(?:
              [049]|
              2[02-68]|
              [35]0|
              6[0-356]|
              8[014-9]
            )|
            5(?:
              0|
              2[0-24-689]|
              4[0-2457-9]|
              6[057-9]|
              8[1-9]|
              90
            )|
            6(?:
              [0-24578]|
              3[06-9]|
              6[14-79]|
              9[03-9]
            )|
            7(?:
              0[02-9]|
              2[0135-79]|
              3[23]|
              4[0-27-9]|
              6[1457]|
              8
            )|
            8(?:
              [046]|
              1[01459]|
              2[0-489]|
              5(?:
                0|
                [23][0-8]
              )|
              8[0-2459]|
              9[09]
            )|
            9(?:
              0[0457]|
              1[08]|
              [268]|
              4[024-9]|
              5[06-9]
            )|
            (?:
              33|
              85[23]9
            )[0-46-9]|
            (?:
              2[0-57-9]|
              3(?:
                [157]\d|
                35|
                49|
                9[1-68]
              )|
              4(?:
                [17]\d|
                2[179]|
                [35][1-9]|
                6[47-9]|
                8[23]
              )|
              5(?:
                [1357]\d|
                2[37]|
                4[36]|
                6[1-46]|
                80|
                9[1-9]
              )|
              6(?:
                3[1-5]|
                6[0238]|
                9[12]
              )|
              7(?:
                01|
                [1579]\d|
                2[248]|
                3[014-9]|
                4[3-6]|
                6[023689]
              )|
              8(?:
                1[236-8]|
                2[5-7]|
                [37]\d|
                5[14-9]|
                8[36-8]|
                9[1-8]
              )|
              9(?:
                0[1-3689]|
                1[1-79]|
                [379]\d|
                4[13]|
                5[1-5]
              )
            )(?:
              [0-8]|
              9[0-47-9]
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              0[02-8]|
              [1-9]
            )|
            2(?:
              [0-57-9][0-8]|
              6
            )|
            3(?:
              [0268]|
              3[0-46-9]|
              4[0-8]|
              9[079]
            )|
            4(?:
              [049]|
              2[02-68]|
              [35]0|
              6[0-356]|
              8[014-9]
            )|
            5(?:
              0|
              2[0-24-689]|
              4[0-2457-9]|
              6[057-9]|
              90
            )|
            6(?:
              [0-24578]|
              3[06-9]|
              6[14-79]|
              9[03-9]
            )|
            7(?:
              0[02-9]|
              2[0135-79]|
              3[23]|
              4[0-27-9]|
              6[1457]|
              8
            )|
            8(?:
              [046]|
              1[01459]|
              2[0-489]|
              5(?:
                0|
                [23](?:
                  [02-8]|
                  1[1-9]|
                  9[0-46-9]
                )
              )|
              8[0-2459]|
              9[09]
            )|
            9(?:
              0[0457]|
              1[08]|
              [268]|
              4[024-9]|
              5[06-9]
            )|
            (?:
              10|
              2[0-57-9]
            )9[0-47-9]|
            (?:
              101|
              58|
              85[23]10
            )[1-9]|
            (?:
              3(?:
                [157]\d|
                35|
                49|
                9[1-68]
              )|
              4(?:
                [17]\d|
                2[179]|
                [35][1-9]|
                6[47-9]|
                8[23]
              )|
              5(?:
                [1357]\d|
                2[37]|
                4[36]|
                6[1-46]|
                80|
                9[1-9]
              )|
              6(?:
                3[1-5]|
                6[0238]|
                9[12]
              )|
              7(?:
                01|
                [1579]\d|
                2[248]|
                3[014-9]|
                4[3-6]|
                6[023689]
              )|
              8(?:
                1[236-8]|
                2[5-7]|
                [37]\d|
                5[14-9]|
                8[36-8]|
                9[1-8]
              )|
              9(?:
                0[1-3689]|
                1[1-79]|
                [379]\d|
                4[13]|
                5[1-5]
              )
            )(?:
              [02-8]|
              1(?:
                0[1-9]|
                [1-9]
              )|
              9[0-47-9]
            )
          </leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 10 digit toll free or shared cost range -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>
            (?:
              4|
              80
            )0
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 10 digit fixed line range -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            10|
            2(?:
              [02-57-9]|
              1[1-9]
            )
          </leadingDigits>
          <leadingDigits>
            10|
            2(?:
              [02-57-9]|
              1[1-9]
            )
          </leadingDigits>
          <leadingDigits>
            10[0-79]|
            2(?:
              [02-57-9]|
              1[1-79]
            )|
            (?:
              10|
              21
            )8(?:
              0[1-9]|
              [1-9]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 10 digit fixed line range -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            3(?:
              [3-59]|
              7[02-68]
            )|
            4(?:
              [26-8]|
              3[3-9]|
              5[2-9]
            )|
            5(?:
              3[03-9]|
              [468]|
              7[028]|
              9[2-46-9]
            )|
            6|
            7(?:
              [0-247]|
              3[04-9]|
              5[0-4689]|
              6[2368]
            )|
            8(?:
              [1-358]|
              9[1-7]
            )|
            9(?:
              [013479]|
              5[1-5]
            )|
            (?:
              [34]1|
              55|
              79|
              87
            )[02-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 10-11 digit shared cost range -->
        <numberFormat pattern="(\d{3})(\d{7,8})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 11 digit fixed line range -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>80</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 11 digit fixed line range -->
        <numberFormat pattern="(\d{3})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>[3-578]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile range -->
        <numberFormat pattern="(\d{3})(\d{4})(\d{4})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>1[3-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 12 digit toll free range -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[12]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1[127]\d{8,9}|
          2\d{9}(?:
            \d{2}
          )?|
          [12]\d{6,7}|
          86\d{6}|
          (?:
            1[03-689]\d|
            6
          )\d{7,9}|
          (?:
            [3-579]\d|
            8[0-57-9]
          )\d{6,9}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="[10-12]"/>
        <nationalNumberPattern>
          (?:
            (?:
              10|
              21
            )8|
            [48]
          )00\d{7}|
          950\d{7,8}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- 0432 increased to 8 digits on October 24, 2009. 0791 increased to 8 digits on August
           28, 2011. 0551 increased to 8 digits and 0565 was cancelled on Dec 8, 2012. 0871
           increased to 8 digits on December 16, 2012. 0475 is the prefix for Tongliao but is not
           in the ITU data.
           10xxx and 95xxx(x) numbers with area codes are also included here, as they behave
           exactly like fixed-line numbers. We don't support them for 4-digit area codes though,
           as they don't seem to be used there based on making actual phone calls. -->
      <fixedLine>
        <possibleLengths national="[7-11]" localOnly="5,6"/>
        <exampleNumber>1012345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            10(?:
              [02-79]\d\d|
              [18](?:
                0[1-9]|
                [1-9]\d
              )
            )|
            21(?:
              [18](?:
                0[1-9]|
                [1-9]\d
              )|
              [2-79]\d\d
            )
          )\d{5}|
          (?:
            43[35]|
            754
          )\d{7,8}|
          8(?:
            078\d{7}|
            51\d{7,8}
          )|
          (?:
            10|
            (?:
              2|
              85
            )1|
            43[35]|
            754
          )(?:
            100\d\d|
            95\d{3,4}
          )|
          (?:
            2[02-57-9]|
            3(?:
              11|
              7[179]
            )|
            4(?:
              [15]1|
              3[12]
            )|
            5(?:
              1\d|
              2[37]|
              3[12]|
              51|
              7[13-79]|
              9[15]
            )|
            7(?:
              [39]1|
              5[57]|
              6[09]
            )|
            8(?:
              71|
              98
            )
          )(?:
            [02-8]\d{7}|
            1(?:
              0(?:
                0\d\d(?:
                  \d{3}
                )?|
                [1-9]\d{5}
              )|
              [1-9]\d{6}
            )|
            9(?:
              [0-46-9]\d{6}|
              5\d{3}(?:
                \d(?:
                  \d{2}
                )?
              )?
            )
          )|
          (?:
            3(?:
              1[02-9]|
              35|
              49|
              5\d|
              7[02-68]|
              9[1-68]
            )|
            4(?:
              1[02-9]|
              2[179]|
              3[46-9]|
              5[2-9]|
              6[47-9]|
              7\d|
              8[23]
            )|
            5(?:
              3[03-9]|
              4[36]|
              5[02-9]|
              6[1-46]|
              7[028]|
              80|
              9[2-46-9]
            )|
            6(?:
              3[1-5]|
              6[0238]|
              9[12]
            )|
            7(?:
              01|
              [17]\d|
              2[248]|
              3[04-9]|
              4[3-6]|
              5[0-3689]|
              6[2368]|
              9[02-9]
            )|
            8(?:
              1[236-8]|
              2[5-7]|
              3\d|
              5[2-9]|
              7[02-9]|
              8[36-8]|
              9[1-7]
            )|
            9(?:
              0[1-3689]|
              1[1-79]|
              [379]\d|
              4[13]|
              5[1-5]
            )
          )(?:
            [02-8]\d{6}|
            1(?:
              0(?:
                0\d\d(?:
                  \d{2}
                )?|
                [1-9]\d{4}
              )|
              [1-9]\d{5}
            )|
            9(?:
              [0-46-9]\d{5}|
              5\d{3,5}
            )
          )
        </nationalNumberPattern>
      </fixedLine>
      <!-- 170, 176 and 177 prefixes are introduced in early 2014 for 4G networks. ITU mentions 13
           digit 10647, 1440 and 10 digit 14[68] ranges as "Non-geographic number, Mobile (IoT
           dedicated)". Library does not support "Internet of things (IoT)" numbers which are
           generally used for communication between the devices. So we don't include 146 here at
           this time. -->
      <mobile>
        <possibleLengths national="11"/>
        <exampleNumber>13123456789</exampleNumber>
        <nationalNumberPattern>
          1740[0-5]\d{6}|
          1(?:
            [38]\d|
            4[57]|
            [59][0-35-9]|
            6[25-7]|
            7[0-35-8]
          )\d{8}
        </nationalNumberPattern>
      </mobile>
      <!-- Toll free, premium rate, and VoIP numbers are not clearly defined in the official Chinese
           number plan, and do not seem to have been standardized. The information below is
           collected from searching the web. 12 digit 800 numbers with area codes of Shanghai(21)
           and Beijing(10) are toll-free based on online references. -->
      <!-- http://en.wikipedia.org/wiki/Toll-free_telephone_number -->
      <tollFree>
        <possibleLengths national="10,12"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              10|
              21
            )8|
            8
          )00\d{7}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>16812345</exampleNumber>
        <nationalNumberPattern>16[08]\d{5}</nationalNumberPattern>
      </premiumRate>
      <!-- 96xxx(x) numbers with area codes are included here. Their costs are not well
           documented, but they are thought to be mostly local costs with certain exceptions. We
           don't support them for 4-digit area codes though, as they don't seem to be used there
           based on online searches. -->
      <sharedCost>
        <possibleLengths national="[7-11]" localOnly="5,6"/>
        <exampleNumber>4001234567</exampleNumber>
        <nationalNumberPattern>
          10(?:
            10\d{4}|
            96\d{3,4}
          )|
          400\d{7}|
          950\d{7,8}|
          (?:
            2[0-57-9]|
            3(?:
              [157]\d|
              35|
              49|
              9[1-68]
            )|
            4(?:
              [17]\d|
              2[179]|
              [35][1-9]|
              6[47-9]|
              8[23]
            )|
            5(?:
              [1357]\d|
              2[37]|
              4[36]|
              6[1-46]|
              80|
              9[1-9]
            )|
            6(?:
              3[1-5]|
              6[0238]|
              9[12]
            )|
            7(?:
              01|
              [1579]\d|
              2[248]|
              3[014-9]|
              4[3-6]|
              6[023689]
            )|
            8(?:
              1[236-8]|
              2[5-7]|
              [37]\d|
              5[14-9]|
              8[36-8]|
              9[1-8]
            )|
            9(?:
              0[1-3689]|
              1[1-79]|
              [379]\d|
              4[13]|
              5[1-5]
            )
          )96\d{3,4}
        </nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Colombia (CO) -->
    <!-- http://www.itu.int/oth/T020200002C/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Colombia -->
    <territory id="CO" countryCode="57" internationalPrefix="00(?:4(?:[14]4|56)|[579])"
               nationalPrefix="0" nationalPrefixForParsing="0([3579]|4(?:[14]4|56))?"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{7})" nationalPrefixFormattingRule="($FG)"
                      carrierCodeFormattingRule="$NP$CC $FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{7})" carrierCodeFormattingRule="$NP$CC $FG">
          <leadingDigits>
            3[0-357]|
            91
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>$1 $2 $3</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            60\d\d|
            9101
          )\d{6}|
          (?:
            1\d|
            3
          )\d{9}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6012345678</exampleNumber>
        <nationalNumberPattern>
          601055(?:
            [0-4]\d|
            50
          )\d\d|
          6010(?:
            [0-4]\d|
            5[0-4]
          )\d{4}|
          60(?:
            [124-7][2-9]|
            8[1-9]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added prefix 323 based on user report and online evidences. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>3211234567</exampleNumber>
        <nationalNumberPattern>
          333301[0-5]\d{3}|
          3333(?:
            00|
            2[5-9]|
            [3-9]\d
          )\d{4}|
          (?:
            3(?:
              24[1-9]|
              3(?:
                00|
                3[0-24-9]
              )
            )|
            9101
          )\d{6}|
          3(?:
            0[0-5]|
            1\d|
            2[0-3]|
            5[01]|
            70
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="11"/>
        <exampleNumber>18001234567</exampleNumber>
        <nationalNumberPattern>1800\d{7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="11"/>
        <exampleNumber>19001234567</exampleNumber>
        <nationalNumberPattern>
          19(?:
            0[01]|
            4[78]
          )\d{7}
        </nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Costa Rica (CR) -->
    <!-- http://www.itu.int/oth/T0202000030/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Costa_Rica -->
    <territory id="CR" countryCode="506" internationalPrefix="00"
               nationalPrefixForParsing="(19(?:0[0-2468]|1[09]|20|66|77|99))">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            [2-7]|
            8[3-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            8\d|
            90
          )\d{8}|
          (?:
            [24-8]\d{3}|
            3005
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Added prefix 20 and 21 found online. Care must be taken to avoid overlapping with
           210[0-6]xxxx, which is clearly marked as VOIP in the ITU document. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22123456</exampleNumber>
        <nationalNumberPattern>
          210[7-9]\d{4}|
          2(?:
            [024-7]\d|
            1[1-9]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>83123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            3005\d|
            6500[01]
          )\d{3}|
          (?:
            5[07]|
            6[0-4]|
            7[0-3]|
            8[3-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
      </tollFree>
      <!-- Includes "mass calls" numbers with prefix 905. -->
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>90[059]\d{7}</nationalNumberPattern>
      </premiumRate>
      <!-- Including trunking service numbers starting with 5100. -->
      <!-- Prefixes for VOIP simplified from wikipedia 4xxx xxxx -->
      <!-- Prefix 210x xxxx present before, taken from ITU doc -->
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>40001234</exampleNumber>
        <nationalNumberPattern>
          (?:
            210[0-6]|
            4\d{3}|
            5100
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Cuba (CU) -->
    <!-- http://www.itu.int/oth/T0202000033/en -->
    <territory id="CU" countryCode="53" internationalPrefix="119" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4,6})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2[1-4]|
            [34]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{6,7})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[56]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [27]\d{6,7}|
          [34]\d{5,7}|
          63\d{6}|
          (?:
            5|
            8\d\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Based on one of the data sources, 80[25] and 878 ranges are fixed-line as per
           Government docs, though no other references are found. -->
      <fixedLine>
        <possibleLengths national="[6-8],10" localOnly="4,5"/>
        <exampleNumber>71234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[23]|
            4[89]
          )\d{4,6}|
          (?:
            31|
            4[36]|
            8(?:
              0[25]|
              78
            )\d
          )\d{6}|
          (?:
            2[1-4]|
            4[1257]|
            7\d
          )\d{5,6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>51234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            5\d|
            63
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
      </tollFree>
      <sharedCost>
        <possibleLengths national="10"/>
        <exampleNumber>8071234567</exampleNumber>
        <nationalNumberPattern>807\d{7}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Cape Verde (CV) -->
    <!-- http://www.itu.int/oth/T0202000026/en -->
    <territory id="CV" countryCode="238" internationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})">
          <leadingDigits>[2-589]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-59]\d\d|
            800
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2211234</exampleNumber>
        <nationalNumberPattern>
          2(?:
            2[1-7]|
            3[0-8]|
            4[12]|
            5[1256]|
            6\d|
            7[1-3]|
            8[1-5]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- It seems, contrary to their numbering plan, the entire 9X range is used for mobile
           phones. SMS messages has been successfully sent to numbers starting with 95 and 97 for
           example, and there are plenty of numbers on the internet that start with these
           prefixes. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>9911234</exampleNumber>
        <nationalNumberPattern>
          (?:
            36|
            5[1-389]|
            9\d
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>800\d{4}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>3401234</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[3-5]|
            4[356]
          )\d{5}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Curaçao (CW) -->
    <!-- Main region for 'BQ' -->
    <!-- http://www.itu.int/oth/T02020000F5/en -->
    <!-- All the formatting patterns for country-code 599 are here. -->
    <territory id="CW" mainCountryForCode="true" countryCode="599" leadingDigits="[69]"
               internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[3467]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4})">
          <leadingDigits>9[4-8]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [34]1|
            60|
            (?:
              7|
              9\d
            )\d
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7,8"/>
        <exampleNumber>94351234</exampleNumber>
        <nationalNumberPattern>
          9(?:
            4(?:
              3[0-5]|
              4[14]|
              6\d
            )|
            50\d|
            7(?:
              2[014]|
              3[02-9]|
              4[4-9]|
              6[357]|
              77|
              8[7-9]
            )|
            8(?:
              3[39]|
              [46]\d|
              7[01]|
              8[57-9]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7,8"/>
        <exampleNumber>95181234</exampleNumber>
        <nationalNumberPattern>
          953[01]\d{4}|
          9(?:
            5[12467]|
            6[5-9]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="8"/>
        <exampleNumber>95581234</exampleNumber>
        <nationalNumberPattern>955\d{5}</nationalNumberPattern>
      </pager>
      <!-- Value-added services are lumped together under shared cost, since we are not sure
           exactly what they are. -->
      <sharedCost>
        <possibleLengths national="7"/>
        <exampleNumber>6001234</exampleNumber>
        <nationalNumberPattern>60[0-2]\d{4}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Christmas Island (CX) -->
    <!-- Calling code and formatting shared with 'AU' -->
    <!-- References state Christmas Islands have fixed line numbers starting +61 8 9164. -->
    <!-- http://en.wikipedia.org/wiki/List_of_country_calling_codes -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Australia -->
    <!-- https://www.thenumberingsystem.com.au/#/number-register/search -->
    <territory id="CX" countryCode="61" preferredInternationalPrefix="0011"
               internationalPrefix="001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011"
               nationalPrefix="0" nationalPrefixForParsing="([59]\d{7})$|0"
               nationalPrefixTransformRule="8$1">
      <generalDesc>
        <nationalNumberPattern>
          1(?:
            [0-79]\d{8}(?:
              \d{2}
            )?|
            8[0-24-9]\d{7}
          )|
          [148]\d{8}|
          1\d{5,7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9" localOnly="8"/>
        <exampleNumber>891641234</exampleNumber>
        <nationalNumberPattern>
          8(?:
            51(?:
              0(?:
                01|
                30|
                59|
                88
              )|
              1(?:
                17|
                46|
                75
              )|
              2(?:
                22|
                35
              )
            )|
            91(?:
              00[6-9]|
              1(?:
                [28]1|
                49|
                78
              )|
              2(?:
                09|
                63
              )|
              3(?:
                12|
                26|
                75
              )|
              4(?:
                56|
                97
              )|
              64\d|
              7(?:
                0[01]|
                1[0-2]
              )|
              958
            )
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Mobile, toll free, premium rate and VOIP copied from Australia. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>412345678</exampleNumber>
        <nationalNumberPattern>
          4(?:
            (?:
              79|
              94
            )[01]|
            83[0-389]
          )\d{5}|
          4(?:
            [0-3]\d|
            4[047-9]|
            5[0-25-9]|
            6[0-36-9]|
            7[02-8]|
            8[0-24-9]|
            9[0-37-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7,10"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          180(?:
            0\d{3}|
            2
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>1900123456</exampleNumber>
        <nationalNumberPattern>190[0-26]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- Local-rate (SmartNumbers) are put here because they are a reverse-charge network,
           although they charge a small local call connect fee (around 25c). These start with 13
           or 1300. -->
      <sharedCost>
        <possibleLengths national="6,8,10,12"/>
        <exampleNumber>1300123456</exampleNumber>
        <nationalNumberPattern>
          13(?:
            00\d{6}(?:
              \d{2}
            )?|
            45[0-4]\d{3}
          )|
          13\d{4}
        </nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>147101234</exampleNumber>
        <nationalNumberPattern>
          14(?:
            5(?:
              1[0458]|
              [23][458]
            )|
            71\d
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Cyprus (CY) -->
    <!-- http://www.itu.int/oth/T0202000034/en -->
    <territory id="CY" countryCode="357" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Format from http://www.cyprusyellowpages.com -->
        <numberFormat pattern="(\d{2})(\d{6})">
          <leadingDigits>[257-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [279]\d|
            [58]0
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22345678</exampleNumber>
        <nationalNumberPattern>2[2-6]\d{6}</nationalNumberPattern>
      </fixedLine>
      <!-- Includes paging numbers (they are mixed into the same block). -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>96123456</exampleNumber>
        <nationalNumberPattern>
          9(?:
            10|
            [4-79]\d
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80001234</exampleNumber>
        <nationalNumberPattern>800\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90012345</exampleNumber>
        <nationalNumberPattern>90[09]\d{5}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>80112345</exampleNumber>
        <nationalNumberPattern>80[1-9]\d{5}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>70012345</exampleNumber>
        <nationalNumberPattern>700\d{5}</nationalNumberPattern>
      </personalNumber>
      <!-- Using for Corporate Network numbers and Universal Service numbers. -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>77123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            50|
            77
          )\d{6}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Czechia (CZ) -->
    <!-- http://www.itu.int/oth/T0202000035/en -->
    <!-- http://en.wikipedia.org/wiki/%2B420 -->
    <territory id="CZ" countryCode="420" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>
            [2-8]|
            9[015-7]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})(\d{2})">
          <leadingDigits>96</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})(\d{3})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{3})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-578]\d|
            60
          )\d{7}|
          9\d{8,11}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>212345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            2\d|
            3[1257-9]|
            4[16-9]|
            5[13-9]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>601123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            60[1-8]\d|
            7(?:
              0(?:
                [2-5]\d|
                60
              )|
              190|
              [2379]\d\d
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <!-- Includes premium rate dial-up. -->
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>
          9(?:
            0[05689]|
            76
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>811234567</exampleNumber>
        <nationalNumberPattern>8[134]\d{7}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>700123456</exampleNumber>
        <nationalNumberPattern>70[01]\d{6}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>910123456</exampleNumber>
        <nationalNumberPattern>9[17]0\d{6}</nationalNumberPattern>
      </voip>
      <!-- Numbers belonging to private communication networks are included here. These are
           classified as Institutional networks, belonging to institutions like the police, armed
           forces and railways, along with a couple of formerly government-owned banks. These
           numbers are reachable by the public. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>972123456</exampleNumber>
        <nationalNumberPattern>
          9(?:
            5\d|
            7[2-4]
          )\d{6}
        </nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="[9-12]"/>
        <exampleNumber>93123456789</exampleNumber>
        <nationalNumberPattern>
          9(?:
            3\d{9}|
            6\d{7,10}
          )
        </nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Germany (DE) -->
    <!-- http://www.itu.int/oth/T0202000051/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_germany -->
    <!-- Due to the high complexity of ranges in the German numbering scheme, the regular
         expressions here have been automatically simplified to reduce size. This means that
         in some cases there may be false positives (especially in fixed line ranges), but since
         German ranges differ so much by length anyway, false positives are already common. -->
    <territory id="DE" countryCode="49" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Fixed line, 2 digit area codes. -->
        <numberFormat pattern="(\d{2})(\d{3,13})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            3[02]|
            40|
            [68]9
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed line, 3 digit area codes. -->
        <numberFormat pattern="(\d{3})(\d{3,12})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            2(?:
              0[1-389]|
              1[124]|
              2[18]|
              3[14]
            )|
            3(?:
              [35-9][15]|
              4[015]
            )|
            906|
            (?:
              2[4-9]|
              4[2-9]|
              [579][1-9]|
              [68][1-8]
            )1
          </leadingDigits>
          <leadingDigits>
            2(?:
              0[1-389]|
              12[0-8]
            )|
            3(?:
              [35-9][15]|
              4[015]
            )|
            906|
            2(?:
              [13][14]|
              2[18]
            )|
            (?:
              2[4-9]|
              4[2-9]|
              [579][1-9]|
              [68][1-8]
            )1
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed line, 4 digit area codes. Only area code 5361 has two digit subscriber numbers. -->
        <numberFormat pattern="(\d{4})(\d{2,11})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [24-6]|
            3(?:
              [3569][02-46-9]|
              4[2-4679]|
              7[2-467]|
              8[2-46-8]
            )|
            70[2-8]|
            8(?:
              0[2-9]|
              [1-8]
            )|
            90[7-9]|
            [79][1-9]
          </leadingDigits>
          <leadingDigits>
            [24-6]|
            3(?:
              3(?:
                0[1-467]|
                2[127-9]|
                3[124578]|
                7[1257-9]|
                8[1256]|
                9[145]
              )|
              4(?:
                2[135]|
                4[13578]|
                9[1346]
              )|
              5(?:
                0[14]|
                2[1-3589]|
                6[1-4]|
                7[13468]|
                8[13568]
              )|
              6(?:
                2[1-489]|
                3[124-6]|
                6[13]|
                7[12579]|
                8[1-356]|
                9[135]
              )|
              7(?:
                2[1-7]|
                4[145]|
                6[1-5]|
                7[1-4]
              )|
              8(?:
                21|
                3[1468]|
                6|
                7[1467]|
                8[136]
              )|
              9(?:
                0[12479]|
                2[1358]|
                4[134679]|
                6[1-9]|
                7[136]|
                8[147]|
                9[1468]
              )
            )|
            70[2-8]|
            8(?:
              0[2-9]|
              [1-8]
            )|
            90[7-9]|
            [79][1-9]|
            3[68]4[1347]|
            3(?:
              47|
              60
            )[1356]|
            3(?:
              3[46]|
              46|
              5[49]
            )[1246]|
            3[4579]3[1357]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Short shared cost numbers. -->
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>138</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed line, 5 digit area codes. -->
        <numberFormat pattern="(\d{5})(\d{2,10})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- UAN (181) numbers. -->
        <numberFormat pattern="(\d{3})(\d{5,11})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>181</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Premium rate and shared cost numbers. -->
        <numberFormat pattern="(\d{3})(\d)(\d{4,10})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              3|
              80
            )|
            9
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile/pager format (from ITU document). Actual usage varies. -->
        <numberFormat pattern="(\d{3})(\d{7,8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1[67]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Toll free (800) numbers. -->
        <numberFormat pattern="(\d{3})(\d{7,12})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Where we have seen prefixes in use for the IVPN/User Group numbers, we format it the
             way it is generally written. For other prefixes, we fall back to using a three-digit
             prefix since we have currently no more information to allow us to format these more
             precisely. -->
        <numberFormat pattern="(\d{5})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>185</leadingDigits>
          <leadingDigits>1850</leadingDigits>
          <leadingDigits>18500</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Personal numbers. -->
        <numberFormat pattern="(\d{3})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Various UAN numbers. -->
        <numberFormat pattern="(\d{4})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>18[68]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Mobile format for 15x mobile numbers. -->
        <numberFormat pattern="(\d{4})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>15[1279]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Some mobile numbers (carrier services etc..) have a 6 digit NSN and need to be formatted
             with 5 leading digits (as opposed to the 4.7 format).
             These are all in the ranges 150, 155, 156 and 158. -->
        <numberFormat pattern="(\d{5})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>15[03568]</leadingDigits>
          <leadingDigits>
            15(?:
              [0568]|
              31
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Various UAN numbers. -->
        <numberFormat pattern="(\d{3})(\d{8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>18</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Voicemail. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{7,8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              6[023]|
              7
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Voicemail. -->
        <numberFormat pattern="(\d{4})(\d{2})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>15[279]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Voicemail. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>15</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [2579]\d{5,14}|
          49(?:
            [34]0|
            69|
            8\d
          )\d\d?|
          49(?:
            37|
            49|
            60|
            7[089]|
            9\d
          )\d{1,3}|
          49(?:
            2[024-9]|
            3[2-689]|
            7[1-7]
          )\d{1,8}|
          (?:
            1|
            [368]\d|
            4[0-8]
          )\d{3,13}|
          49(?:
            [015]\d|
            2[13]|
            31|
            [46][1-8]
          )\d{1,9}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The German ITU numbering plan gives overly simplistic minimum/maximum
           lengths for number ranges. This would (if taken literally) result in 1 or 2 length
           subscriber numbers. However, a contact of the German numbering authority
           confirmed that subscriber numbers can never be shorter than 2-digit and total
           length can not be less than 6 digits. Prefix 4921 of length 13-digit is added
           based on user report. Prefix 322 of length 9-digits is added based on user report. -->
      <!-- Maximum lengths of German numbers are generally undefined, since any subscriber
           number can connect to a private exchange (PABX), which can consume additionally
           dialled digits (e.g. for calling individual rooms in a hotel directly). This means that in
           almost all cases the maximum length of a fixed line range is 15 (the maximum defined
           by E.164). However there is one very special exception to this; the "49" area code.
           This needs to be shorter to avoid range lengths overlapping which would otherwise
           cause issues in parsing (since 49 is both an area code and the country calling code). -->
      <fixedLine>
        <possibleLengths national="[5-15]" localOnly="[2-4]"/>
        <exampleNumber>30123456</exampleNumber>
        <nationalNumberPattern>
          32\d{9,11}|
          49[1-6]\d{10}|
          322\d{6}|
          49[0-7]\d{3,9}|
          (?:
            [34]0|
            [68]9
          )\d{3,13}|
          (?:
            2(?:
              0[1-689]|
              [1-3569]\d|
              4[0-8]|
              7[1-7]|
              8[0-7]
            )|
            3(?:
              [3569]\d|
              4[0-79]|
              7[1-7]|
              8[1-8]
            )|
            4(?:
              1[02-9]|
              [2-48]\d|
              5[0-6]|
              6[0-8]|
              7[0-79]
            )|
            5(?:
              0[2-8]|
              [124-6]\d|
              [38][0-8]|
              [79][0-7]
            )|
            6(?:
              0[02-9]|
              [1-358]\d|
              [47][0-8]|
              6[1-9]
            )|
            7(?:
              0[2-8]|
              1[1-9]|
              [27][0-7]|
              3\d|
              [4-6][0-8]|
              8[0-5]|
              9[013-7]
            )|
            8(?:
              0[2-9]|
              1[0-79]|
              2\d|
              3[0-46-9]|
              4[0-6]|
              5[013-9]|
              6[1-8]|
              7[0-8]|
              8[0-24-6]
            )|
            9(?:
              0[6-9]|
              [1-4]\d|
              [589][0-7]|
              6[0-8]|
              7[0-467]
            )
          )\d{3,12}
        </nationalNumberPattern>
      </fixedLine>
      <!-- According to
           http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/BNetzA/Sachgebiete/Telekommunikation/Regulierung/Nummernverwaltung/Mobilfunkdienste/NummernplanMobileDienstepdf.pdf?__blob=publicationFile
           numbers beginning with 162, 163 and 17 can all be 10 or 11 digits long.
           The ranges 15[056] have been removed from the ITU doc, but information found online
           indicates that they may still be working.
           Note corresponding voicemail prefixes should be updated as well if new prefixes are
           added to this section. -->
      <mobile>
        <possibleLengths national="10,11"/>
        <exampleNumber>15123456789</exampleNumber>
        <nationalNumberPattern>
          15(?:
            [0-25-9]\d\d|
            310
          )\d{6}|
          1(?:
            6[023]|
            7\d
          )\d{7,8}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="[4-14]"/>
        <exampleNumber>16412345</exampleNumber>
        <nationalNumberPattern>
          16(?:
            4\d{1,10}|
            [89]\d{1,11}
          )
        </nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="[10-15]"/>
        <exampleNumber>8001234567890</exampleNumber>
        <nationalNumberPattern>800\d{7,12}</nationalNumberPattern>
      </tollFree>
      <!-- Includes the more expensive of the "televoting" line numbers. See the shared cost
           section for more information. -->
      <premiumRate>
        <possibleLengths national="10,11"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            137[7-9]|
            900(?:
              [135]|
              9\d
            )
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <!-- Includes some mass-traffic numbers, used for e.g. phone voting, raffles, since their
           costs when dialling from a fixed-line phone is similar.
           Prices:
           http://www.billiger-telefonieren.de/0180-0137-0900-sonderrufnummern/
           Documentation:
           http://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Nummerierung/Rufnummern/0137/0137_Nummernplan.pdf?__blob=publicationFile&v=2 -->
      <sharedCost>
        <possibleLengths national="[7-14]"/>
        <exampleNumber>18012345</exampleNumber>
        <nationalNumberPattern>
          180\d{5,11}|
          13(?:
            7[1-6]\d\d|
            8
          )\d{4}
        </nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="11"/>
        <exampleNumber>70012345678</exampleNumber>
        <nationalNumberPattern>700\d{8}</nationalNumberPattern>
      </personalNumber>
      <!-- Using UAN for numbers marked in the plan as being assigned to International Virtual
           Private Networks (0181) and User Groups (018[2-9]). These seem in practice to be assigned
           to companies. More information here: http://de.wikipedia.org/wiki/Vorwahl_01 -->
      <uan>
        <possibleLengths national="[8-14]"/>
        <exampleNumber>18500123456</exampleNumber>
        <nationalNumberPattern>
          18(?:
            1\d{5,11}|
            [2-9]\d{8}
          )
        </nationalNumberPattern>
      </uan>
      <!-- Note corresponding mobile prefixes should be updated as well if new prefixes are added
           to this section. -->
      <voicemail>
        <possibleLengths national="12,13"/>
        <exampleNumber>177991234567</exampleNumber>
        <nationalNumberPattern>
          1(?:
            6(?:
              013|
              255|
              399
            )|
            7(?:
              (?:
                [015]1|
                [69]3
              )3|
              [2-4]55|
              [78]99
            )
          )\d{7,8}|
          15(?:
            (?:
              [03-68]00|
              113
            )\d|
            2\d55|
            7\d99|
            9\d33
          )\d{7}
        </nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Djibouti (DJ) -->
    <!-- http://www.itu.int/oth/T020200003A/en -->
    <territory id="DJ" countryCode="253" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[27]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            2\d|
            77
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Includes "Numéro long CDMA fixe" numbers. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21360003</exampleNumber>
        <nationalNumberPattern>
          2(?:
            1[2-5]|
            7[45]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>77831001</exampleNumber>
        <nationalNumberPattern>77\d{6}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Denmark (DK) -->
    <!-- http://www.dba.erhvervsstyrelsen.dk/numbering-lists -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Denmark -->
    <!-- https://www.itu.int/oth/T0202000038/en -->
    <territory id="DK" countryCode="45" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-9]\d{7}</nationalNumberPattern>
      </generalDesc>
      <!-- Note that "mainly mobile" and "mainly fixed-line" are put under both number types to be
           safe. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>32123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            [2-7]\d|
            8[126-9]|
            9[1-46-9]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>32123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            [2-7]\d|
            8[126-9]|
            9[1-46-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>80\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>90\d{6}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Dominica (DM) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T020200003B/en -->
    <territory id="DM" countryCode="1" leadingDigits="767" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-7]\d{6})$|1"
               nationalPrefixTransformRule="767$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            767|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7674201234</exampleNumber>
        <nationalNumberPattern>
          767(?:
            2(?:
              55|
              66
            )|
            4(?:
              2[01]|
              4[0-25-9]
            )|
            50[0-4]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 61[237], 285 and 295 since online numbers have been found with this prefix. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7672251234</exampleNumber>
        <nationalNumberPattern>
          767(?:
            2(?:
              [2-4689]5|
              7[5-7]
            )|
            31[5-7]|
            61[1-8]|
            70[1-6]
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Dominican Republic (DO) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T020200003C/en -->
    <territory id="DO" countryCode="1" leadingDigits="8001|8[024]9" internationalPrefix="011"
               nationalPrefix="1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The ITU data seems to be somewhat incomplete. We ensure that the fully-specified mobile
           prefixes in the document are classified as such by excluding them from the fixed-line
           ranges, but other than this have a generic rule. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8092345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            [04]9[2-9]\d\d|
            29(?:
              2(?:
                [0-59]\d|
                6[04-9]|
                7[0-27]|
                8[0237-9]
              )|
              3(?:
                [0-35-9]\d|
                4[7-9]
              )|
              [45]\d\d|
              6(?:
                [0-27-9]\d|
                [3-5][1-9]|
                6[0135-8]
              )|
              7(?:
                0[013-9]|
                [1-37]\d|
                4[1-35689]|
                5[1-4689]|
                6[1-57-9]|
                8[1-79]|
                9[1-8]
              )|
              8(?:
                0[146-9]|
                1[0-48]|
                [248]\d|
                3[1-79]|
                5[01589]|
                6[013-68]|
                7[124-8]|
                9[0-8]
              )|
              9(?:
                [0-24]\d|
                3[02-46-9]|
                5[0-79]|
                60|
                7[0169]|
                8[57-9]|
                9[02-9]
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8092345678</exampleNumber>
        <nationalNumberPattern>8[024]9[2-9]\d{6}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002123456</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00(?:
              14|
              [2-9]\d
            )|
            (?:
              33|
              44|
              55|
              66|
              77|
              88
            )[2-9]\d
          )\d{5}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002123456</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Algeria (DZ) -->
    <!-- http://www.itu.int/oth/T0202000003/en -->
    <!-- http://www.arpt.dz -->
    <territory id="DZ" countryCode="213" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- Formatting from http://www.pagesjaunes-dz.com. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-4]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[5-8]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [1-4]|
            [5-79]\d|
            80
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- We include the VSAT lines here. -->
      <!-- Added prefix 23 found online. -->
      <fixedLine>
        <possibleLengths national="8,9"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          9619\d{5}|
          (?:
            1\d|
            2[013-79]|
            3[0-8]|
            4[013-689]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 65 and 78 from numbers found online. Also, prefix 670 is added since the carrier
           Mobilis Algeria provided it, and 54 for Nedjma. Prefixes 67[1-4] were also added for
           Mobilis Algeria based on evidence found online. Added new ranges 675 and 676 as
           per IR21 received. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>551234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            5(?:
              4[0-29]|
              5\d|
              6[0-2]
            )|
            6(?:
              [569]\d|
              7[0-6]
            )|
            7[7-9]\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>808123456</exampleNumber>
        <nationalNumberPattern>80[3-689]1\d{5}</nationalNumberPattern>
      </premiumRate>
      <!-- The Algerian plan doesn't specify where the costs start to be considered "premium", so we
           draw an arbitrary line here and say that from 50 Da up they will be considered premium. -->
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>801123456</exampleNumber>
        <nationalNumberPattern>80[12]1\d{5}</nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>983123456</exampleNumber>
        <nationalNumberPattern>98[23]\d{6}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Ecuador (EC) -->
    <!-- http://en.wikipedia.org/wiki/+593 -->
    <!-- http://www.arcotel.gob.ec/plan-tecnico-fundamental-de-numeracion-series-numericas/ -->
    <!-- http://www.itu.int/oth/T020200003D/en -->
    <territory id="EC" countryCode="593" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-7]</leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>[2-7]</leadingDigits>
          <format>$1 $2-$3</format>
          <intlFormat>$1-$2-$3</intlFormat>
        </numberFormat>
        <!-- Formatting for the new longer mobile numbers comes from the advertisements about the
             change on the http://www.conatel.gob.ec site. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3,4})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1\d{9,10}|
          (?:
            [2-7]|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8" localOnly="7"/>
        <exampleNumber>22123456</exampleNumber>
        <nationalNumberPattern>[2-7][2-7]\d{6}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>991234567</exampleNumber>
        <nationalNumberPattern>
          964[0-2]\d{5}|
          9(?:
            39|
            [57][89]|
            6[0-36-9]|
            [89]\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10,11"/>
        <exampleNumber>18001234567</exampleNumber>
        <nationalNumberPattern>
          1800\d{7}|
          1[78]00\d{6}
        </nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>28901234</exampleNumber>
        <nationalNumberPattern>[2-7]890\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Estonia (EE) -->
    <!-- http://www.itu.int/oth/T0202000043/en -->
    <territory id="EE" countryCode="372" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            [369]|
            4[3-8]|
            5(?:
              [0-2]|
              5[0-478]|
              6[45]
            )|
            7[1-9]|
            88
          </leadingDigits>
          <leadingDigits>
            [369]|
            4[3-8]|
            5(?:
              [02]|
              1(?:
                [0-8]|
                95
              )|
              5[0-478]|
              6(?:
                4[0-4]|
                5[1-589]
              )
            )|
            7[1-9]|
            88
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3,4})">
          <leadingDigits>
            [45]|
            8(?:
              00|
              [1-49]
            )
          </leadingDigits>
          <leadingDigits>
            [45]|
            8(?:
              00[1-9]|
              [1-49]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{4})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          8\d{9}|
          [4578]\d{7}|
          (?:
            [3-8]\d|
            90
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="7"/>
        <nationalNumberPattern>800[2-9]\d{3}</nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>3212345</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[23589]|
            4[3-8]|
            6\d|
            7[1-9]|
            88
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 7 digit mobile numbers currently in use with special prefixes are preserved - new
           numbers are 8 digits. -->
      <mobile>
        <possibleLengths national="7,8"/>
        <exampleNumber>51234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            5\d{5}|
            8(?:
              1(?:
                0(?:
                  0(?:
                    00|
                    [178]\d
                  )|
                  [3-9]\d\d
                )|
                (?:
                  1(?:
                    0[236]|
                    1\d
                  )|
                  (?:
                    2[0-59]|
                    [3-79]\d
                  )\d
                )\d
              )|
              2(?:
                0(?:
                  0(?:
                    00|
                    4\d
                  )|
                  (?:
                    19|
                    [2-7]\d
                  )\d
                )|
                (?:
                  (?:
                    [124-6]\d|
                    3[5-9]
                  )\d|
                  7(?:
                    [0-79]\d|
                    8[13-9]
                  )|
                  8(?:
                    [2-6]\d|
                    7[01]
                  )
                )\d
              )|
              [349]\d{4}
            )
          )\d\d|
          5(?:
            (?:
              [02]\d|
              5[0-478]
            )\d|
            1(?:
              [0-8]\d|
              95
            )|
            6(?:
              4[0-4]|
              5[1-589]
            )
          )\d{3}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7,8,10"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>
          800(?:
            (?:
              0\d\d|
              1
            )\d|
            [2-9]
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <!-- Supporting eFax numbers here as well. We aren't sure the exact cost, but have
           had user reports that they are expensive to dial. -->
      <premiumRate>
        <possibleLengths national="7,8"/>
        <exampleNumber>9001234</exampleNumber>
        <nationalNumberPattern>
          (?:
            40\d\d|
            900
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>70012345</exampleNumber>
        <nationalNumberPattern>70[0-2]\d{5}</nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Egypt (EG) -->
    <!-- http://www.itu.int/oth/T020200003E/en -->
    <territory id="EG" countryCode="20" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{7,8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[23]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1[35]|
            [4-6]|
            8[2468]|
            9[235-7]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [189]\d{8,9}|
          [24-6]\d{8}|
          [135]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Subscriber numbers starting with 5 are also permitted for the area codes 040, with 5, 6
           and 7 for the area code 050, with 5 and 7 for 082, with 6 for 084, with 7 for 086 and
           092 and with 5 and 6 for 96. -->
      <fixedLine>
        <possibleLengths national="8,9" localOnly="6,7"/>
        <exampleNumber>234567890</exampleNumber>
        <nationalNumberPattern>
          13[23]\d{6}|
          (?:
            15|
            57
          )\d{6,7}|
          (?:
            2[2-4]|
            3|
            4[05-8]|
            5[05]|
            6[24-689]|
            8[2468]|
            9[235-7]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>1001234567</exampleNumber>
        <nationalNumberPattern>1[0-25]\d{8}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Western Sahara (EH) -->
    <!-- Calling code and formatting shared with 'MA' -->
    <!-- Two area codes are defined in the Morocco ITU document; 05288 XXXXX and 05289 XXXXX -->
    <!-- http://www.itu.int/oth/T0202000090/en -->
    <territory id="EH" countryCode="212" leadingDigits="528[89]" internationalPrefix="00"
               nationalPrefix="0">
      <generalDesc>
        <nationalNumberPattern>[5-8]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>528812345</exampleNumber>
        <nationalNumberPattern>528[89]\d{5}</nationalNumberPattern>
      </fixedLine>
      <!-- The following sections are copied verbatim from Morocco to allow these non-geographical
           numbers to be recognized as available from within Western Sahara. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>650123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            6(?:
              [0-79]\d|
              8[0-247-9]
            )|
            7(?:
              [0167]\d|
              2[0-4]|
              5[01]|
              8[0-3]
            )
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>80[0-7]\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>891234567</exampleNumber>
        <nationalNumberPattern>89\d{7}</nationalNumberPattern>
      </premiumRate>
      <!-- Putting VSAT numbers here. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>592401234</exampleNumber>
        <nationalNumberPattern>
          (?:
            592(?:
              4[0-2]|
              93
            )|
            80[89]\d\d
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Eritrea (ER) -->
    <!-- http://www.itu.int/oth/T0202000042/en -->
    <territory id="ER" countryCode="291" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[178]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[178]\d{6}</nationalNumberPattern>
      </generalDesc>
      <!-- Test number from plan. -->
      <fixedLine>
        <possibleLengths national="7" localOnly="6"/>
        <exampleNumber>8370362</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              1[12568]|
              [24]0|
              55|
              6[146]
            )|
            8\d\d
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- It is unclear in the plan whether the 07 mobile prefix superseded the previous 017[1-3]
           numbers or was in addition to them, so we support both here. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>7123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            17[1-3]|
            7\d\d
          )\d{4}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Spain (ES) -->
    <!-- http://www.minetur.gob.es/telecomunicaciones/es-ES/Servicios/Numeracion/Documents/14-10_Descripcion_PNN.pdf -->
    <territory id="ES" countryCode="34" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 4-digit shortcodes which would otherwise be formatted as 'XXX X' -->
        <numberFormat pattern="(\d{4})">
          <leadingDigits>905</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 6-digit shortcodes which would otherwise be formatted as 'XXX XX X' -->
        <numberFormat pattern="(\d{6})">
          <leadingDigits>[79]9</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Toll free numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>[89]00</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[5-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[5-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <!-- The pattern is complex because the Lleida Networks mobile ranges are inside the
           fixed-line ranges. As per official announcement, 919 prefix is assigned to
           Madrid area http://www.boe.es/boe/dias/2016/11/17/pdfs/BOE-A-2016-10756.pdf. -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>810123456</exampleNumber>
        <nationalNumberPattern>
          96906(?:
            0[0-8]|
            1[1-9]|
            [2-9]\d
          )\d\d|
          9(?:
            69(?:
              0[0-57-9]|
              [1-9]\d
            )|
            73(?:
              [0-8]\d|
              9[1-9]
            )
          )\d{4}|
          (?:
            8(?:
              [1356]\d|
              [28][0-8]|
              [47][1-9]
            )|
            9(?:
              [135]\d|
              [268][0-8]|
              4[1-9]|
              7[124-9]
            )
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- The ranges 969060900 to 969061099 and 973900000 to 973909999 are mobile according to
           information received from Lleida Networks. Added 78 range based on user bug reports. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>612345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            590[16]00\d|
            9(?:
              6906(?:
                09|
                10
              )|
              7390\d\d
            )
          )\d\d|
          (?:
            6\d|
            7[1-48]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>[89]00\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>803123456</exampleNumber>
        <nationalNumberPattern>80[367]\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>901123456</exampleNumber>
        <nationalNumberPattern>90[12]\d{6}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>701234567</exampleNumber>
        <nationalNumberPattern>70\d{7}</nationalNumberPattern>
      </personalNumber>
      <!-- Modelling non-geographic nomadic numbers as UAN. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>511234567</exampleNumber>
        <nationalNumberPattern>51\d{7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Ethiopia (ET) -->
    <!-- http://www.itu.int/oth/T0202000044/en -->
    <territory id="ET" countryCode="251" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-579]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            11|
            [2-579]\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Found valid fixed-line numbers online that starts with prefix 11 617, 11 639 and
           11 667[01]. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>111112345</exampleNumber>
        <nationalNumberPattern>
          11667[01]\d{3}|
          (?:
            11(?:
              1(?:
                1[124]|
                2[2-7]|
                3[1-5]|
                5[5-8]|
                8[6-8]
              )|
              2(?:
                13|
                3[6-8]|
                5[89]|
                7[05-9]|
                8[2-6]
              )|
              3(?:
                2[01]|
                3[0-289]|
                4[1289]|
                7[1-4]|
                87
              )|
              4(?:
                1[69]|
                3[2-49]|
                4[0-3]|
                6[5-8]
              )|
              5(?:
                1[578]|
                44|
                5[0-4]
              )|
              6(?:
                1[578]|
                2[69]|
                39|
                4[5-7]|
                5[0-5]|
                6[0-59]|
                8[015-8]
              )
            )|
            2(?:
              2(?:
                11[1-9]|
                22[0-7]|
                33\d|
                44[1467]|
                66[1-68]
              )|
              5(?:
                11[124-6]|
                33[2-8]|
                44[1467]|
                55[14]|
                66[1-3679]|
                77[124-79]|
                880
              )
            )|
            3(?:
              3(?:
                11[0-46-8]|
                (?:
                  22|
                  55
                )[0-6]|
                33[0134689]|
                44[04]|
                66[01467]
              )|
              4(?:
                44[0-8]|
                55[0-69]|
                66[0-3]|
                77[1-5]
              )
            )|
            4(?:
              6(?:
                119|
                22[0-24-7]|
                33[1-5]|
                44[13-69]|
                55[14-689]|
                660|
                88[1-4]
              )|
              7(?:
                (?:
                  11|
                  22
                )[1-9]|
                33[13-7]|
                44[13-6]|
                55[1-689]
              )
            )|
            5(?:
              7(?:
                227|
                55[05]|
                (?:
                  66|
                  77
                )[14-8]
              )|
              8(?:
                11[149]|
                22[013-79]|
                33[0-68]|
                44[013-8]|
                550|
                66[1-5]|
                77\d
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- The data here is not regularly updated by the Ethiopian authorities, and many more
           numbers are visible online than are reported in the ITU document. We have also
           referred to IR 21 docs as they are frequently updated. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>911234567</exampleNumber>
        <nationalNumberPattern>
          700[1-9]\d{5}|
          (?:
            7(?:
              0[1-9]|
              1[0-8]|
              22|
              77|
              86|
              99
            )|
            9\d\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Finland (FI) -->
    <!-- Main region for 'AX' -->
    <!-- Adding all international carrier access codes in below doc that we found corroborating
         evidence for. https://www.viestintavirasto.fi/en/internettelephone/numberingoftelecommunicationsnetworks/internationalcalls/internationalcarrieraccesscodes.html -->
    <!-- Not supporting national long distance carrier codes as these are overlapping with UAN
         ranges mentioned in ITU doc. -->
    <!-- https://www.viestintavirasto.fi/internetpuhelin/puhelinverkonnumerointi.html -->
    <territory id="FI" mainCountryForCode="true" countryCode="358" leadingDigits="1[03-79]|[2-9]"
               preferredInternationalPrefix="00"
               internationalPrefix="00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))"
               nationalPrefix="0" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Most service numbers are included under UAN in PhoneNumberMetadata.xml (and also in
             the no-international-dialling block) but prefixes 75[12] are always short and used
             for directory services so are covered in ShortNumberMetadata.xml intead. However,
             they still need a national prefix so we have a formatting rule here. -->
        <numberFormat pattern="(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>75[12]</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Format for 5 digit UAN numbers. -->
        <numberFormat pattern="(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>20[2-59]</leadingDigits>
          <format>$1</format>
        </numberFormat>
        <!-- Format for 6 digit short codes. -->
        <numberFormat pattern="(\d{6})">
          <leadingDigits>11</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- General format for 3-digit prefix (6-10 digit numbers). -->
        <numberFormat pattern="(\d{3})(\d{3,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              [1-3]0|
              [68]
            )0|
            70[07-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- General format for 2-digit prefix (6-10 digit numbers). -->
        <numberFormat pattern="(\d{2})(\d{4,8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [14]|
            2[09]|
            50|
            7[135]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6,10})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- General format for 1-digit prefix (5-10 digit numbers). -->
        <numberFormat pattern="(\d)(\d{4,9})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              1[3-79]|
              [2568]
            )[1-8]|
            3(?:
              0[1-9]|
              [1-9]
            )|
            9
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-35689]\d{4}|
          7\d{10,11}|
          (?:
            [124-7]\d|
            3[0-46-9]
          )\d{8}|
          [1-9]\d{5,8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- According to the national numbering plan, service numbers are in general not accessible
           from abroad, although 600/700/800 numbers may be. -->
      <noInternationalDialling>
        <possibleLengths national="[5-12]"/>
        <nationalNumberPattern>
          20(?:
            2[023]|
            9[89]
          )\d{1,6}|
          (?:
            60[12]\d|
            7099
          )\d{4,5}|
          (?:
            606|
            7(?:
              0[78]|
              1|
              3\d
            )
          )\d{7}|
          (?:
            [1-3]00|
            7(?:
              0[1-5]\d\d|
              5[03-9]
            )
          )\d{3,7}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- This is limited to geographic numbers - non-geographic nationwide subscriber numbers
           are listed under UAN. It also excludes Åland numbers.  Only 5, 7, 8 and 9 digit numbers
           are possible as per www.viestintavirasto.fi's plan. Supporting other lengths based on
           user reports. -->
      <fixedLine>
        <possibleLengths national="[5-9]"/>
        <exampleNumber>131234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[3-79][1-8]|
            [23568][1-8]\d|
            9(?:
              00|
              [1-8]\d
            )
          )\d{2,6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Only 8, 9 and 10 digit numbers are possible as per www.viestintavirasto.fi's plan.
           Supporting other lengths based on user reports. -->
      <mobile>
        <possibleLengths national="[6-10]"/>
        <exampleNumber>412345678</exampleNumber>
        <nationalNumberPattern>
          4946\d{2,6}|
          (?:
            4[0-8]|
            50
          )\d{4,8}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[7-9]"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{4,6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8,9"/>
        <exampleNumber>600123456</exampleNumber>
        <nationalNumberPattern>[67]00\d{5,6}</nationalNumberPattern>
      </premiumRate>
      <!-- Covers nationwide non-geographic numbers, and nationwide "service numbers", typically
           assigned to institutions such as universities, the national post, etc, where they are
           not otherwise classified as toll-free or premium-rate numbers. -->
      <uan>
        <possibleLengths national="[5-12]"/>
        <exampleNumber>10112345</exampleNumber>
        <nationalNumberPattern>
          20\d{4,8}|
          60[12]\d{5,6}|
          7(?:
            099\d{4,5}|
            5[03-9]\d{3,7}
          )|
          20[2-59]\d\d|
          (?:
            606|
            7(?:
              0[78]|
              1|
              3\d
            )
          )\d{7}|
          (?:
            10|
            29|
            3[09]|
            70[1-5]\d
          )\d{4,8}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Fiji (FJ) -->
    <!-- http://www.itu.int/oth/T0202000048/en -->
    <!-- http://www.tfl.com.fj -->
    <territory id="FJ" countryCode="679" preferredInternationalPrefix="00"
               internationalPrefix="0(?:0|52)">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            [235-9]|
            45
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          45\d{5}|
          (?:
            0800\d|
            [235-9]
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Adding the prefixes 30X, 31X and 62X, since numbers with these prefixes have been found
           online, including in the white pages. 35X and 85X were found in the exchanges listed on
           http://www.tfl.com.fj. Prefix 603 is added based on user report and online results. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>3212345</exampleNumber>
        <nationalNumberPattern>
          603\d{4}|
          (?:
            3[0-5]|
            6[25-7]|
            8[58]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>7012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            [279]\d|
            45|
            5[01568]|
            8[034679]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Information found on http://www.tfl.com.fj. It is not clear if these are
           internationally diallable, or if so, how. -->
      <tollFree>
        <possibleLengths national="11"/>
        <exampleNumber>08001234567</exampleNumber>
        <nationalNumberPattern>0800\d{7}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Falkland Islands (Islas Malvinas) (FK) -->
    <!-- http://www.itu.int/oth/T0202000046/en -->
    <territory id="FK" countryCode="500" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>[2-7]\d{4}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="5"/>
        <exampleNumber>31234</exampleNumber>
        <nationalNumberPattern>[2-47]\d{4}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="5"/>
        <exampleNumber>51234</exampleNumber>
        <nationalNumberPattern>[56]\d{4}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Micronesia (FM) -->
    <!-- http://www.itu.int/oth/T020200008B/en -->
    <territory id="FM" countryCode="691" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[389]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [39]\d\d|
            820
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>3201234</exampleNumber>
        <nationalNumberPattern>
          31(?:
            00[67]|
            208|
            309
          )\d\d|
          (?:
            3(?:
              [2357]0[1-9]|
              602|
              804|
              905
            )|
            (?:
              820|
              9[2-6]\d
            )\d
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Note that most ranges are used for both fixed and mobile but numbers starting with 97X
           are exclusively mobile. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>3501234</exampleNumber>
        <nationalNumberPattern>
          31(?:
            00[67]|
            208|
            309
          )\d\d|
          (?:
            3(?:
              [2357]0[1-9]|
              602|
              804|
              905
            )|
            (?:
              820|
              9[2-7]\d
            )\d
          )\d{3}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Faroe Islands (FO) -->
    <!-- http://www.itu.int/oth/T0202000047/en -->
    <!-- All numbers are formatted together, as a block. -->
    <territory id="FO" countryCode="298" internationalPrefix="00"
               nationalPrefixForParsing="(10(?:01|[12]0|88))">
      <availableFormats>
        <numberFormat pattern="(\d{6})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-9]\d{5}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="6"/>
        <exampleNumber>201234</exampleNumber>
        <nationalNumberPattern>
          (?:
            20|
            [34]\d|
            8[19]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="6"/>
        <exampleNumber>211234</exampleNumber>
        <nationalNumberPattern>
          (?:
            [27][1-9]|
            5\d|
            9[16]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="6"/>
        <exampleNumber>802123</exampleNumber>
        <nationalNumberPattern>80[257-9]\d{3}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="6"/>
        <exampleNumber>901123</exampleNumber>
        <nationalNumberPattern>
          90(?:
            [13-5][15-7]|
            2[125-7]|
            9\d
          )\d\d
        </nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="6"/>
        <exampleNumber>601234</exampleNumber>
        <nationalNumberPattern>
          (?:
            6[0-36]|
            88
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- France (FR) -->
    <!-- http://www.itu.int/oth/T020200004A/en -->
    <!-- http://www.arcep.fr/index.php?id=8146 -->
    <!-- http://en.wikipedia.org/wiki/%2B33 -->
    <!-- https://extranet.arcep.fr/portail/Op%C3%A9rateursCE/Num%C3%A9rotation.aspx -->
    <!-- Short numbers will be formatted as a block without a national prefix. -->
    <territory id="FR" countryCode="33" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 4-digit shortcodes. -->
        <numberFormat pattern="(\d{4})">
          <leadingDigits>10</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 6-digit shortcodes. -->
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Variable cost (toll free, premium rate etc.) -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- General format (fixed, mobile, voip) -->
        <numberFormat pattern="(\d)(\d{2})(\d{2})(\d{2})(\d{2})"
                      nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-79]</leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            26[013-9]|
            59[1-35-9]
          )\d{6}|
          (?:
            [13]\d|
            2[0-57-9]|
            4[1-9]|
            5[0-8]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 700 numbers are mobile phone services as per https://www.arcep.fr/index.php?id=8146
           where length is mentioned as 'extended length numbers'. As we are not sure, supporting
           it as regular 9 digit range. Sub ranges are assigned to mobile operators as per:
           https://www.arcep.fr/index.php?id=interactivenumeros&no_cache=1 -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>612345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            6(?:
              [0-24-8]\d|
              3[0-8]|
              9[589]
            )|
            7[3-9]\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>891123456</exampleNumber>
        <nationalNumberPattern>
          836(?:
            0[0-36-9]|
            [1-9]\d
          )\d{4}|
          8(?:
            1[2-9]|
            2[2-47-9]|
            3[0-57-9]|
            [569]\d|
            8[0-35-9]
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>884012345</exampleNumber>
        <nationalNumberPattern>
          8(?:
            1[01]|
            2[0156]|
            4[02]|
            84
          )\d{6}
        </nationalNumberPattern>
      </sharedCost>
      <!-- 087 numbers used to be used for this. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>9\d{8}</nationalNumberPattern>
      </voip>
      <!-- 80[6-9] numbers cost the same as fixed-line calls, but are not geographically assigned,
           so we classify them as UAN. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>806123456</exampleNumber>
        <nationalNumberPattern>80[6-9]\d{6}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Gabon (GA) -->
    <!-- Note: We cannot set nationalPrefix="0" while fixed line numbers can start with a zero
         as this breaks parsing (it treats all leading zeros as national prefixes. -->
    <!-- http://www.itu.int/oth/T020200004E/en -->
    <!-- http://www.arcep.ga -->
    <territory id="GA" countryCode="241" internationalPrefix="00"
               nationalPrefixForParsing="0(11\d{6}|60\d{6}|61\d{6}|6[256]\d{6}|7[467]\d{6})"
               nationalPrefixTransformRule="$1">
      <availableFormats>
        <!-- If no leading zero was supplied, format with the national prefix. -->
        <numberFormat pattern="(\d)(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="0$FG">
          <leadingDigits>[2-7]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- This already has a leading zero so we format is "as is". -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Even in new way of dialling, 0 is mandatory when dialling domestically. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="0$FG">
          <leadingDigits>
            11|
            [67]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [067]\d|
            11
          )\d{6}|
          [2-7]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Gabon has undergone renumbering in November 2019 where the prefix 01 is changed to 011;
           and intial "0" is no more needed when dialled internationally. Thus they become 7 digit
           to 8 digit excluding 0. -->
      <!-- About numbers in older version, which may soon get invalid:
           A 7-digit fixed-line plan was scheduled to be implemented on June 17, 2012 to unify fixed
           line and mobile numbering. However, this has only partially happened; mobile numbers can
           now be dialed without a leading zero, but fixed line numbers still require it. Their own
           website still lists fixed line numbers as "+241 01 44 68 11" and upon ringing they will
           not connect from outside the country without the 0. This was last tested March 2014. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>01441234</exampleNumber>
        <nationalNumberPattern>[01]1\d{6}</nationalNumberPattern>
      </fixedLine>
      <!-- Gabon has undergone renumbering in November 2019 where the prefixes 0[256] are changed
           to 6[256] respectively and similarly 0[47] changed to 7[47]. The intial "0" is no more
           needed when dialled internationally. Thus they become 7 digit to 8 digit excluding 0. -->
      <!-- About old numbers, which may soon get invalid: Mobile numbers can be 7 or 8 digits
           (with or without a leading zero). -->
      <!-- Prefix 7658 is added based on user report. -->
      <mobile>
        <possibleLengths national="7,8"/>
        <exampleNumber>06031234</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              0[2-7]|
              7[467]
            )\d|
            6(?:
              0[0-4]|
              10|
              [256]\d
            )
          )\d{5}|
          [2-7]\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- United Kingdom (GB) -->
    <!-- Main region for 'GG,IM,JE' -->
    <!-- Note that this excludes Isle of Man, Jersey and Guernsey prefixes for the purposes of
         validation, although the formatting rules are shared. Also numbers are fine-grained where
         needed in order to disambiguate between the 4 regions. -->
    <!-- http://static.ofcom.org.uk/static/numbering/ -->
    <!-- http://stakeholders.ofcom.org.uk/telecoms/numbering/ -->
    <!-- http://en.wikipedia.org/wiki/List_of_United_Kingdom_dialling_codes -->
    <!-- http://www.numberingplans.com/?page=dialling&sub=areacodes&ac=GB -->
    <territory id="GB" mainCountryForCode="true" countryCode="44" internationalPrefix="00"
               nationalPrefix="0" preferredExtnPrefix=" x" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Special case: 800 1111 (UK Child Line). -->
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>800</leadingDigits>
          <leadingDigits>8001</leadingDigits>
          <leadingDigits>80011</leadingDigits>
          <leadingDigits>800111</leadingDigits>
          <leadingDigits>8001111</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Special case: 845 46 47 (UK NHS Direct). -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>845</leadingDigits>
          <leadingDigits>8454</leadingDigits>
          <leadingDigits>84546</leadingDigits>
          <leadingDigits>845464</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Shorter than normal toll-free numbers (9-digits). -->
        <numberFormat pattern="(\d{3})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>800</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 5-digit area codes (9 or 10 digit numbers).
             These area codes are very rare in GB, and are only available in the following places:
             13873(Langholm), 15242(Hornby), 15394(Hawkshead), 15395(Grange-over-Sands),
             15396(Sedbergh), 16973(Wigton), 16974(Raughton Head), 16977(Brampton),
             17683(Appleby), 17684(Pooley Bridge), 17687(Keswick), 19467(Gosforth). -->
        <numberFormat pattern="(\d{5})(\d{4,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              38|
              5[23]|
              69|
              76|
              94
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              (?:
                38|
                69
              )7|
              5(?:
                24|
                39
              )|
              768|
              946
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              3873|
              5(?:
                242|
                39[4-6]
              )|
              (?:
                697|
                768
              )[347]|
              9467
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 4-digit area codes (9 or 10 digit numbers). -->
        <numberFormat pattern="(\d{4})(\d{5,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              [2-69][02-9]|
              [78]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 2-digit area codes and other 2-4-4 formats (pager, uan etc.)
             2d, 55, 56, 70 and 76 pager numbers (excludes 7624) with 10 digits. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [25]|
            7(?:
              0|
              6[02-9]
            )
          </leadingDigits>
          <leadingDigits>
            [25]|
            7(?:
              0|
              6(?:
                [03-9]|
                2[356]
              )
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 7ddd (not 70, 76) with 10 digits. Includes 7624 for IM. -->
        <numberFormat pattern="(\d{4})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 3-digit area codes and other 3-3-4 formats (fixed line, premium rate, toll free etc.)
             For geographic area codes: 11d, 1d1, 3dd, 9dd -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1389]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-357-9]\d{9}|
          [18]\d{8}|
          8\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- http://en.wikipedia.org/wiki/List_of_United_Kingdom_dialling_codes -->
      <!-- Pattern matches geographic NSN=10 numbers as follows:
           - area code and local number first digit for 2+8,
           - area code and local number first digit for 3+7,
           - area code only for 4+6 (including areas with embedded 5+5).
           Pattern matches geographic NSN=9 numbers as follows:
           - area code and local number first two digits for 4+5,
           - area code and local number first three digits for 4+5 special case (01768) 88Ddd,
           - area code and local number first digit for 5+4 special case (016977) Dddd.
           All patterns exclude ranges used in GG, IM, JE. -->
      <fixedLine>
        <possibleLengths national="9,10" localOnly="[4-8]"/>
        <exampleNumber>1212345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              1(?:
                3(?:
                  [0-58]\d\d|
                  73[0235]
                )|
                4(?:
                  [0-5]\d\d|
                  69[7-9]|
                  70[0-79]
                )|
                (?:
                  (?:
                    5[0-26-9]|
                    [78][0-49]
                  )\d|
                  6(?:
                    [0-4]\d|
                    50
                  )
                )\d
              )|
              (?:
                2(?:
                  (?:
                    0[024-9]|
                    2[3-9]|
                    3[3-79]|
                    4[1-689]|
                    [58][02-9]|
                    6[0-47-9]|
                    7[013-9]|
                    9\d
                  )\d|
                  1(?:
                    [0-7]\d|
                    8[0-2]
                  )
                )|
                (?:
                  3(?:
                    0\d|
                    1[0-8]|
                    [25][02-9]|
                    3[02-579]|
                    [468][0-46-9]|
                    7[1-35-79]|
                    9[2-578]
                  )|
                  4(?:
                    0[03-9]|
                    [137]\d|
                    [28][02-57-9]|
                    4[02-69]|
                    5[0-8]|
                    [69][0-79]
                  )|
                  5(?:
                    0[1-35-9]|
                    [16]\d|
                    2[024-9]|
                    3[015689]|
                    4[02-9]|
                    5[03-9]|
                    7[0-35-9]|
                    8[0-468]|
                    9[0-57-9]
                  )|
                  6(?:
                    0[034689]|
                    1\d|
                    2[0-35689]|
                    [38][013-9]|
                    4[1-467]|
                    5[0-69]|
                    6[13-9]|
                    7[0-8]|
                    9[0-24578]
                  )|
                  7(?:
                    0[0246-9]|
                    2\d|
                    3[0236-8]|
                    4[03-9]|
                    5[0-46-9]|
                    6[013-9]|
                    7[0-35-9]|
                    8[024-9]|
                    9[02-9]
                  )|
                  8(?:
                    0[35-9]|
                    2[1-57-9]|
                    3[02-578]|
                    4[0-578]|
                    5[124-9]|
                    6[2-69]|
                    7\d|
                    8[02-9]|
                    9[02569]
                  )|
                  9(?:
                    0[02-589]|
                    [18]\d|
                    2[02-689]|
                    3[1-57-9]|
                    4[2-9]|
                    5[0-579]|
                    6[2-47-9]|
                    7[0-24578]|
                    9[2-57]
                  )
                )\d
              )\d
            )|
            2(?:
              0[013478]|
              3[0189]|
              4[017]|
              8[0-46-9]|
              9[0-2]
            )\d{3}
          )\d{4}|
          1(?:
            2(?:
              0(?:
                46[1-4]|
                87[2-9]
              )|
              545[1-79]|
              76(?:
                2\d|
                3[1-8]|
                6[1-6]
              )|
              9(?:
                7(?:
                  2[0-4]|
                  3[2-5]
                )|
                8(?:
                  2[2-8]|
                  7[0-47-9]|
                  8[3-5]
                )
              )
            )|
            3(?:
              6(?:
                38[2-5]|
                47[23]
              )|
              8(?:
                47[04-9]|
                64[0157-9]
              )
            )|
            4(?:
              044[1-7]|
              20(?:
                2[23]|
                8\d
              )|
              6(?:
                0(?:
                  30|
                  5[2-57]|
                  6[1-8]|
                  7[2-8]
                )|
                140
              )|
              8(?:
                052|
                87[1-3]
              )
            )|
            5(?:
              2(?:
                4(?:
                  3[2-79]|
                  6\d
                )|
                76\d
              )|
              6(?:
                26[06-9]|
                686
              )
            )|
            6(?:
              06(?:
                4\d|
                7[4-79]
              )|
              295[5-7]|
              35[34]\d|
              47(?:
                24|
                61
              )|
              59(?:
                5[08]|
                6[67]|
                74
              )|
              9(?:
                55[0-4]|
                77[23]
              )
            )|
            7(?:
              26(?:
                6[13-9]|
                7[0-7]
              )|
              (?:
                442|
                688
              )\d|
              50(?:
                2[0-3]|
                [3-68]2|
                76
              )
            )|
            8(?:
              27[56]\d|
              37(?:
                5[2-5]|
                8[239]
              )|
              843[2-58]
            )|
            9(?:
              0(?:
                0(?:
                  6[1-8]|
                  85
                )|
                52\d
              )|
              3583|
              4(?:
                66[1-8]|
                9(?:
                  2[01]|
                  81
                )
              )|
              63(?:
                23|
                3[1-4]
              )|
              9561
            )
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- http://stakeholders.ofcom.org.uk/telecoms/numbering/telephone-no-availability/numbers-administered/
           7100-7599, 7700-7999 with 10 digits; excluding ranges used in GG, IM, JE. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>7400123456</exampleNumber>
        <nationalNumberPattern>
          7(?:
            457[0-57-9]|
            700[01]|
            911[028]
          )\d{5}|
          7(?:
            [1-3]\d\d|
            4(?:
              [0-46-9]\d|
              5[0-689]
            )|
            5(?:
              0[0-8]|
              [13-9]\d|
              2[0-35-9]
            )|
            7(?:
              0[1-9]|
              [1-7]\d|
              8[02-9]|
              9[0-689]
            )|
            8(?:
              [014-9]\d|
              [23][0-8]
            )|
            9(?:
              [024-9]\d|
              1[02-9]|
              3[0-689]
            )
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- 76 with 10 digits; excluding ranges used in IM. Prefix 7691 is been supported based on
           user report. -->
      <pager>
        <possibleLengths national="10"/>
        <exampleNumber>7640123456</exampleNumber>
        <nationalNumberPattern>
          76(?:
            464|
            652
          )\d{5}|
          76(?:
            0[0-28]|
            2[356]|
            34|
            4[01347]|
            5[49]|
            6[0-369]|
            77|
            8[14]|
            9[139]
          )\d{6}
        </nationalNumberPattern>
      </pager>
      <!-- Source for non geographic numbers:
           http://en.wikipedia.org/wiki/Non-geographic_telephone_numbers_in_the_United_Kingdom -->
      <!-- 800 1111 with 7 digits, 800 with 9 or 10 digits, 808 with 10 digits. -->
      <tollFree>
        <possibleLengths national="7,9,10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          80[08]\d{7}|
          800\d{6}|
          8001111
        </nationalNumberPattern>
      </tollFree>
      <!-- Note that only 908, 909, 980-989 are reserved for "adult services" while the other
           premium rate ranges are reserved for standard services. Revenue sharing number ranges
           84X and 87X are supported as premium rate as they incur additional service charge
           (which is usually additional to call charge). -->
      <premiumRate>
        <possibleLengths national="7,10"/>
        <exampleNumber>9012345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            8(?:
              4[2-5]|
              7[0-3]
            )|
            9(?:
              [01]\d|
              8[2-49]
            )
          )\d{7}|
          845464\d
        </nationalNumberPattern>
      </premiumRate>
      <!-- 70 with 10 digits. -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>7012345678</exampleNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
      </personalNumber>
      <!-- 56 with 10 digits. -->
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>5612345678</exampleNumber>
        <nationalNumberPattern>56\d{8}</nationalNumberPattern>
      </voip>
      <!-- 30d, 33d, 34d, 37d, 55 with 10 digits. -->
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>5512345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[0347]|
            55
          )\d{8}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Grenada (GD) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000057/en -->
    <territory id="GD" countryCode="1" leadingDigits="473" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
               nationalPrefixTransformRule="473$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            473|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>4732691234</exampleNumber>
        <nationalNumberPattern>
          473(?:
            2(?:
              3[0-2]|
              69
            )|
            3(?:
              2[89]|
              86
            )|
            4(?:
              [06]8|
              3[5-9]|
              4[0-49]|
              5[5-79]|
              73|
              90
            )|
            63[68]|
            7(?:
              58|
              84
            )|
            800|
            938
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>4734031234</exampleNumber>
        <nationalNumberPattern>
          473(?:
            4(?:
              0[2-79]|
              1[04-9]|
              2[0-5]|
              58
            )|
            5(?:
              2[01]|
              3[3-8]
            )|
            901
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Georgia (GE) -->
    <!-- It seems there may be special 6 digit numbers beginning with 91, but we are not sure, so
         these are omitted for now. -->
    <!-- http://www.itu.int/oth/T0202000050/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Georgia_(country) -->
    <territory id="GE" countryCode="995" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>70</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- This format is for two digit area code fixed line range of Tblisi(32). -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>32</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[57]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Format isn't very strictly defined - the yellow pages omits area code and does 2 2 2
             the communications commission uses 2 3 3. Wikipedia says 3 2 3. Some use 2 6. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[348]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [3-57]\d\d|
            800
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Online numbers mention that this is not internationally diallable. -->
      <noInternationalDialling>
        <possibleLengths national="9"/>
        <nationalNumberPattern>70[67]\d{6}</nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="9" localOnly="6,7"/>
        <exampleNumber>322123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              [256]\d|
              4[124-9]|
              7[0-4]
            )|
            4(?:
              1\d|
              2[2-7]|
              3[1-79]|
              4[2-8]|
              7[239]|
              9[1-7]
            )
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 54444 is the only assigned range we have found, but we support all of 544 to keep the
           regex simple. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>555123456</exampleNumber>
        <nationalNumberPattern>
          5(?:
            (?:
              (?:
                0555|
                1(?:
                  [17]77|
                  555
                )
              )[5-9]|
              757(?:
                7[7-9]|
                8[01]
              )
            )\d|
            22252[0-4]
          )\d\d|
          (?:
            5(?:
              00(?:
                0\d|
                11|
                22|
                33|
                44|
                5[05]|
                77|
                88|
                9[09]
              )|
              1(?:
                1(?:
                  00|
                  [124]\d|
                  3[01]
                )|
                4\d\d
              )|
              (?:
                44|
                68
              )\d\d|
              5(?:
                [0157-9]\d\d|
                200
              )|
              7(?:
                [0147-9]\d\d|
                5(?:
                  00|
                  [57]5
                )
              )|
              8(?:
                0(?:
                  [018]\d|
                  2[0-4]
                )|
                58[89]|
                8(?:
                  55|
                  88
                )
              )|
              9(?:
                090|
                [1-35-9]\d\d
              )
            )|
            790\d\d
          )\d{4}|
          5(?:
            0(?:
              0[17]0|
              505
            )|
            1(?:
              0[01]0|
              1(?:
                07|
                33|
                51
              )
            )|
            2(?:
              0[02]0|
              2[25]2
            )|
            3(?:
              0[03]0|
              3[35]3
            )|
            (?:
              40[04]|
              900
            )0|
            5222
          )[0-4]\d{3}
        </nationalNumberPattern>
      </mobile>
      <!-- Information from http://www.yell.ge, examples such as Wissol Petroleum Georgia
           hotline. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <!-- http://www.mydivert.com/virtual-numbers/995-virtual-number-National.html -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>706123456</exampleNumber>
        <nationalNumberPattern>70[67]\d{6}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- French Guiana (GF) -->
    <!-- Using a national prefix here as online numbers are formatted with it. -->
    <!-- The 876 prefix is mentioned in the plan, but the plan is from 2006 and in France VOIP
         numbers were changed from 087 to the 09 prefix in 2009. It is likely this occurred here
         too. -->
    <!-- http://www.itu.int/oth/T020200004C/en -->
    <!-- http://www.arcep.fr/index.php?id=2137&bloc=0594&CMD=RESULTS_NUMEROTATION -->
    <!-- http://www.arcep.fr/uploads/tx_gsavis/11-1297.pdf -->
    <!-- https://extranet.arcep.fr/portail/Op%C3%A9rateursCE/Num%C3%A9rotation.aspx -->
    <territory id="GF" countryCode="594" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [56]|
            9[47]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [56]94\d{6}|
          (?:
            80|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>594101234</exampleNumber>
        <nationalNumberPattern>
          594(?:
            [02-49]\d|
            1[0-5]|
            5[6-9]|
            6[0-3]|
            80
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- As per Wikipedia Guyane Téléphone Mobile operator is no longer functioning. However we
           support these ranges as they are still mentioned in ARCEP numbering plan doc. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>694201234</exampleNumber>
        <nationalNumberPattern>
          694(?:
            [0-249]\d|
            3[0-8]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as
           Toll-free numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>976012345</exampleNumber>
        <nationalNumberPattern>
          9(?:
            (?:
              396|
              76\d
            )\d|
            476[0-5]
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Guernsey (GG) -->
    <!-- Calling code and formatting shared with 'GB' -->
    <!-- Note that the numbers are fine-grained where needed in order to disambiguate between the
         4 regions i.e UK, Isle of Man, Jersey and Guernsey. -->
    <!-- http://static.ofcom.org.uk/static/numbering/ -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom -->
    <territory id="GG" countryCode="44" internationalPrefix="00" nationalPrefix="0"
               nationalPrefixForParsing="([25-9]\d{5})$|0" nationalPrefixTransformRule="1481$1">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1481|
            [357-9]\d{3}
          )\d{6}|
          8\d{6}(?:
            \d{2}
          )?
        </nationalNumberPattern>
      </generalDesc>
      <!-- Specific to GG. -->
      <!-- 1481 with 10 digits. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="6"/>
        <exampleNumber>1481256789</exampleNumber>
        <nationalNumberPattern>1481[25-9]\d{5}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>7781123456</exampleNumber>
        <nationalNumberPattern>
          7(?:
            (?:
              781|
              839
            )\d|
            911[17]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Other numbers as per GB. -->
      <pager>
        <possibleLengths national="10"/>
        <exampleNumber>7640123456</exampleNumber>
        <nationalNumberPattern>
          76(?:
            464|
            652
          )\d{5}|
          76(?:
            0[0-28]|
            2[356]|
            34|
            4[01347]|
            5[49]|
            6[0-369]|
            77|
            8[14]|
            9[139]
          )\d{6}
        </nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="7,9,10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          80[08]\d{7}|
          800\d{6}|
          8001111
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7,10"/>
        <exampleNumber>9012345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            8(?:
              4[2-5]|
              7[0-3]
            )|
            9(?:
              [01]\d|
              8[0-3]
            )
          )\d{7}|
          845464\d
        </nationalNumberPattern>
      </premiumRate>
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>7012345678</exampleNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>5612345678</exampleNumber>
        <nationalNumberPattern>56\d{8}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>5512345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[0347]|
            55
          )\d{8}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Ghana (GH) -->
    <!-- No premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T0202000052/en -->
    <!-- http://www.nca.org.gh/index.php?option=com_content&view=article&id=90&Itemid=65 -->
    <territory id="GH" countryCode="233" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            [237]|
            8[0-2]
          </leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[235]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [235]\d{3}|
            800
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="8"/>
        <nationalNumberPattern>800\d{5}</nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>302345678</exampleNumber>
        <nationalNumberPattern>
          3082[0-5]\d{4}|
          3(?:
            0(?:
              [237]\d|
              8[01]
            )|
            [167](?:
              2[0-6]|
              7\d|
              80
            )|
            2(?:
              2[0-5]|
              7\d|
              80
            )|
            3(?:
              2[0-3]|
              7\d|
              80
            )|
            4(?:
              2[013-9]|
              3[01]|
              7\d|
              80
            )|
            5(?:
              2[0-7]|
              7\d|
              80
            )|
            8(?:
              2[0-2]|
              7\d|
              80
            )|
            9(?:
              [28]0|
              7\d
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>231234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              [0346-9]\d|
              5[67]
            )|
            5(?:
              [03-7]\d|
              9[1-9]
            )
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Found online references to these numbers, although they are not in the plan since they
           are not internationally diallable. -->
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>800\d{5}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Gibraltar (GI) -->
    <!-- http://www.gra.gi/communications/numbering-plan -->
    <territory id="GI" countryCode="350" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Most numbers are formatted as a block -->
        <numberFormat pattern="(\d{3})(\d{5})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [25]\d|
            60
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>20012345</exampleNumber>
        <nationalNumberPattern>
          2190[0-2]\d{3}|
          2(?:
            0(?:
              [02]\d|
              3[01]
            )|
            16[24-9]|
            2[2-5]\d
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>57123456</exampleNumber>
        <nationalNumberPattern>
          5251[0-4]\d{3}|
          (?:
            5(?:
              [146-8]\d\d|
              250
            )|
            60(?:
              1[01]|
              6\d
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Greenland (GL) -->
    <!-- http://www.itu.int/oth/T0202000056/en -->
    <territory id="GL" countryCode="299" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            19|
            [2-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            19|
            [2-689]\d|
            70
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Including VSAT numbers here. -->
      <fixedLine>
        <possibleLengths national="6"/>
        <exampleNumber>321000</exampleNumber>
        <nationalNumberPattern>
          (?:
            19|
            3[1-7]|
            [68][1-9]|
            70|
            9\d
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="6"/>
        <exampleNumber>221234</exampleNumber>
        <nationalNumberPattern>[245]\d{5}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="6"/>
        <exampleNumber>801234</exampleNumber>
        <nationalNumberPattern>80\d{4}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="6"/>
        <exampleNumber>381234</exampleNumber>
        <nationalNumberPattern>3[89]\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Gambia (GM) -->
    <!-- http://www.itu.int/oth/T020200004F/en -->
    <territory id="GM" countryCode="220" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-9]\d{6}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>5661234</exampleNumber>
        <nationalNumberPattern>
          (?:
            4(?:
              [23]\d\d|
              4(?:
                1[024679]|
                [6-9]\d
              )
            )|
            5(?:
              5(?:
                3\d|
                4[0-7]
              )|
              6[67]\d|
              7(?:
                1[04]|
                2[035]|
                3[58]|
                48
              )
            )|
            8\d{3}
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>3012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            [23679]\d|
            5[0-489]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Guinea (GN) -->
    <!-- http://www.itu.int/oth/T020200005B/en -->
    <territory id="GN" countryCode="224" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[67]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          722\d{6}|
          (?:
            3|
            6\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>30241234</exampleNumber>
        <nationalNumberPattern>
          3(?:
            0(?:
              24|
              3[12]|
              4[1-35-7]|
              5[13]|
              6[189]|
              [78]1|
              9[1478]
            )|
            1\d\d
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Prefixes here match those assigned to carriers, as per the ITU communication Jan 23rd
           2013. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>601123456</exampleNumber>
        <nationalNumberPattern>6[0-356]\d{7}</nationalNumberPattern>
      </mobile>
      <!-- Gamma concept network is being listed as VoIP as per
           http://www.gammaconcept.com/internet%20sat.html -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>722123456</exampleNumber>
        <nationalNumberPattern>722\d{6}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Guadeloupe (GP) -->
    <!-- Main region for 'BL,MF' -->
    <!-- Linked from http://www.arcep.fr/index.php?id=interactivenumeros -->
    <!-- http://www.itu.int/oth/T0202000058/en -->
    <!-- https://extranet.arcep.fr/portail/Op%C3%A9rateursCE/Num%C3%A9rotation.aspx -->
    <!-- There is a direct link to accurate numbering assignments in the ITU document, but this does not always load:
         https://extranet.arcep.fr/portail/LinkClick.aspx?fileticket=PBA1WK-wnOU%3d&tabid=217&portalid=0&mid=850
         This should be a spreadsheet containing ~28,000 rows, in which the Guadeloupe allocations are shown, but
         sometimes it only loads part of the spreadsheet (depending on your browser).
         The ranges in this spreadsheet are more accurate than the ITU document, which only has 3-digit prefixes and
         no operator assignments. -->
    <territory id="GP" mainCountryForCode="true" countryCode="590" internationalPrefix="00"
               nationalPrefix="0" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[569]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          590\d{6}|
          (?:
            69|
            80|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>590201234</exampleNumber>
        <nationalNumberPattern>
          590(?:
            0[1-68]|
            [14][0-24-9]|
            2[0-68]|
            3[1-9]|
            5[3-579]|
            [68][0-689]|
            7[08]|
            9\d
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Any ranges assigned from http://www.arcep.fr/index.php?id=interactivenumeros have been
           listed as belonging to Guadeloupe, St Martin and St Barthélemy, since we can't reliably
           distinguish between them. As per Wikipedia Guadeloupe Téléphone Mobile operator is no
           longer functioning. However we support these ranges as they are still mentioned in
           ARCEP numbering plan doc. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>690001234</exampleNumber>
        <nationalNumberPattern>
          69(?:
            0\d\d|
            1(?:
              2[2-9]|
              3[0-5]
            )|
            4(?:
              0[89]|
              1[2-6]|
              9\d
            )|
            6(?:
              1[016-9]|
              5[0-4]|
              [67]\d
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as Toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>976012345</exampleNumber>
        <nationalNumberPattern>
          9(?:
            (?:
              39[5-7]|
              76[018]
            )\d|
            475[0-5]
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Equatorial Guinea (GQ) -->
    <!-- http://www.itu.int/oth/T0202000041/en -->
    <territory id="GQ" countryCode="240" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>[235]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{6})">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          222\d{6}|
          (?:
            3\d|
            55|
            [89]0
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>333091234</exampleNumber>
        <nationalNumberPattern>
          33[0-24-9]\d[46]\d{4}|
          3(?:
            33|
            5\d
          )\d[7-9]\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>222123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            222|
            55\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Note that personal and sharedCost numbers are said to go under here too - hopefully when
           they start allocating them there will be a differentiation of prefixes, but this is not
           clear now. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>80\d[1-9]\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>90\d[1-9]\d{5}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Greece (GR) -->
    <!-- http://www.itu.int/oth/T0202000055/en -->
    <!-- http://en.wikipedia.org/wiki/%2B30 -->
    <!-- http://www.eett.gr/opencms/opencms/EETT_EN/Electronic_Communications/Telecoms/Numbering/NumberAssignments.html -->
    <territory id="GR" countryCode="30" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>
            21|
            7
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{6})">
          <leadingDigits>
            2(?:
              2|
              3[2-57-9]|
              4[2-469]|
              5[2-59]|
              6[2-9]|
              7[2-69]|
              8[2-49]
            )|
            5
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>[2689]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3,4})(\d{5})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          5005000\d{3}|
          8\d{9,11}|
          (?:
            [269]\d|
            70
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10"/>
        <exampleNumber>2123456789</exampleNumber>
        <nationalNumberPattern>
          2(?:
            1\d\d|
            2(?:
              2[1-46-9]|
              [36][1-8]|
              4[1-7]|
              5[1-4]|
              7[1-5]|
              [89][1-9]
            )|
            3(?:
              1\d|
              2[1-57]|
              [35][1-3]|
              4[13]|
              7[1-7]|
              8[124-6]|
              9[1-79]
            )|
            4(?:
              1\d|
              2[1-8]|
              3[1-4]|
              4[13-5]|
              6[1-578]|
              9[1-5]
            )|
            5(?:
              1\d|
              [29][1-4]|
              3[1-5]|
              4[124]|
              5[1-6]
            )|
            6(?:
              1\d|
              [269][1-6]|
              3[1245]|
              4[1-7]|
              5[13-9]|
              7[14]|
              8[1-5]
            )|
            7(?:
              1\d|
              2[1-5]|
              3[1-6]|
              4[1-7]|
              5[1-57]|
              6[135]|
              9[125-7]
            )|
            8(?:
              1\d|
              2[1-5]|
              [34][1-4]|
              9[1-57]
            )
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>6912345678</exampleNumber>
        <nationalNumberPattern>
          68[57-9]\d{7}|
          (?:
            69|
            94
          )\d{8}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[10-12]"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7,9}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9091234567</exampleNumber>
        <nationalNumberPattern>90[19]\d{7}</nationalNumberPattern>
      </premiumRate>
      <!-- Including calls with maximum charge of 0,25 EUR/minute here instead of under premium
           rate. -->
      <sharedCost>
        <possibleLengths national="10"/>
        <exampleNumber>8011234567</exampleNumber>
        <nationalNumberPattern>
          8(?:
            0[16]|
            12|
            [27]5|
            50
          )\d{7}
        </nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>7012345678</exampleNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
      </personalNumber>
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>5005000123</exampleNumber>
        <nationalNumberPattern>5005000\d{3}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Guatemala (GT) -->
    <!-- http://www.itu.int/oth/T020200005A/en -->
    <!-- http://www.sit.gob.gt/index.php?page=plan-de-numeracion -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Guatemala -->
    <territory id="GT" countryCode="502" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[2-8]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          80\d{6}|
          (?:
            1\d{3}|
            [2-7]
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22456789</exampleNumber>
        <nationalNumberPattern>[267][2-9]\d{6}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>51234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            [3-5]\d\d|
            80[0-4]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="11"/>
        <exampleNumber>18001112222</exampleNumber>
        <nationalNumberPattern>18[01]\d{8}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="11"/>
        <exampleNumber>19001112222</exampleNumber>
        <nationalNumberPattern>19\d{9}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Guam (GU) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.nationalnanpa.com/nas/public/assigned_code_query_step1.do?method=resetCodeQueryModel -->
    <territory id="GU" countryCode="1" leadingDigits="671" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
               nationalPrefixTransformRule="671$1">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            671|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Added 671 400/489/555/68[23]/720/721/972 based on information from
           http://www.area-codes.com/area-code/area-code-671.asp -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6713001234</exampleNumber>
        <nationalNumberPattern>
          671(?:
            2\d\d|
            3(?:
              00|
              3[39]|
              4[349]|
              55|
              6[26]
            )|
            4(?:
              00|
              56|
              7[1-9]|
              8[02-46-9]
            )|
            5(?:
              55|
              6[2-5]|
              88
            )|
            6(?:
              3[2-578]|
              4[24-9]|
              5[34]|
              78|
              8[235-9]
            )|
            7(?:
              [0479]7|
              2[0167]|
              3[45]|
              8[7-9]
            )|
            8(?:
              [2-57-9]8|
              6[48]
            )|
            9(?:
              2[29]|
              6[79]|
              7[1279]|
              8[7-9]|
              9[78]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- We assume mobile phone numbers to be the same as fixed-line - further info unavailable -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6713001234</exampleNumber>
        <nationalNumberPattern>
          671(?:
            2\d\d|
            3(?:
              00|
              3[39]|
              4[349]|
              55|
              6[26]
            )|
            4(?:
              00|
              56|
              7[1-9]|
              8[02-46-9]
            )|
            5(?:
              55|
              6[2-5]|
              88
            )|
            6(?:
              3[2-578]|
              4[24-9]|
              5[34]|
              78|
              8[235-9]
            )|
            7(?:
              [0479]7|
              2[0167]|
              3[45]|
              8[7-9]
            )|
            8(?:
              [2-57-9]8|
              6[48]
            )|
            9(?:
              2[29]|
              6[79]|
              7[1279]|
              8[7-9]|
              9[78]
            )
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Guinea-Bissau (GW) -->
    <!-- http://www.itu.int/oth/T020200005C/en -->
    <territory id="GW" countryCode="245" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>40</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>[49]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [49]\d{8}|
          4\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>443201234</exampleNumber>
        <nationalNumberPattern>443\d{6}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>955012345</exampleNumber>
        <nationalNumberPattern>
          9(?:
            5\d|
            6[569]|
            77
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>4012345</exampleNumber>
        <nationalNumberPattern>40\d{5}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Guyana (GY) -->
    <!-- http://www.itu.int/oth/T020200005D/en -->
    <territory id="GY" countryCode="592" internationalPrefix="001">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-8]\d{3}|
            9008
          )\d{3}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2201234</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              1[6-9]|
              2[0-35-9]|
              3[1-4]|
              5[3-9]|
              6\d|
              7[0-79]
            )|
            3(?:
              2[25-9]|
              3\d
            )|
            4(?:
              4[0-24]|
              5[56]
            )|
            50[0-6]|
            77[1-57]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Although the ITU document would allow for a stricter pattern, the country has a track
           record of underreporting valid mobile ranges and 6XXXXXX is almost fully assigned.
           A more lenient pattern is better here. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>6091234</exampleNumber>
        <nationalNumberPattern>
          (?:
            510|
            6\d\d|
            7(?:
              [01]\d|
              2[156]|
              31|
              49
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>2891234</exampleNumber>
        <nationalNumberPattern>
          (?:
            289|
            8(?:
              00|
              6[28]|
              88|
              99
            )
          )\d{4}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>9008123</exampleNumber>
        <nationalNumberPattern>9008\d{3}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>5151234</exampleNumber>
        <nationalNumberPattern>515\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Hong Kong (HK) -->
    <!-- http://www.ofca.gov.hk/en/industry_focus/telecommunications/portability/index.html -->
    <territory id="HK" countryCode="852" preferredInternationalPrefix="00"
               internationalPrefix="00(?:30|5[09]|[126-9]?)" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2,5})">
          <leadingDigits>900</leadingDigits>
          <leadingDigits>9003</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>
            [2-7]|
            8[1-4]|
            9(?:
              0[1-9]|
              [1-8]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})(\d{3})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          8[0-46-9]\d{6,7}|
          9\d{4,7}|
          (?:
            [2-7]|
            9\d{3}
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              [13-9]\d|
              2[013-9]
            )\d|
            3(?:
              (?:
                [1569][0-24-9]|
                4[0-246-9]|
                7[0-24-69]
              )\d|
              8(?:
                4[0-8]|
                [59]\d|
                6[01]
              )
            )|
            58(?:
              0[1-9]|
              1[2-9]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Prefixes assigned to 'CMMobile Global Communications Ltd' are on hold as per Ofcom
           24 Nov 2017 update, but we continue to support them as there is no much information
           when these numbers will be reactivated again. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>51234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            4(?:
              44[0-25-9]|
              6(?:
                1[0-7]|
                4[0-57-9]|
                6[0-4]
              )
            )|
            5(?:
              73[0-6]|
              95[0-8]
            )|
            6(?:
              26[013-8]|
              66[0-3]
            )|
            70(?:
              7[1-8]|
              8[0-4]
            )|
            848[0-35-9]|
            9(?:
              29[013-9]|
              39[01]|
              59[0-4]|
              899
            )
          )\d{4}|
          (?:
            4(?:
              4[0-35-8]|
              6[02357-9]
            )|
            5(?:
              [1-59][0-46-9]|
              6[0-4689]|
              7[0-246-9]
            )|
            6(?:
              0[1-9]|
              [13-59]\d|
              [268][0-57-9]|
              7[0-79]
            )|
            70[129]|
            84[0-29]|
            9(?:
              0[1-9]|
              1[02-9]|
              [2358][0-8]|
              [467]\d
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="8"/>
        <exampleNumber>71123456</exampleNumber>
        <nationalNumberPattern>
          7(?:
            1(?:
              0[0-38]|
              1[0-3679]|
              3[013]|
              69|
              9[0136]
            )|
            2(?:
              [02389]\d|
              1[18]|
              7[27-9]
            )|
            3(?:
              [0-38]\d|
              7[0-369]|
              9[2357-9]
            )|
            47\d|
            5(?:
              [178]\d|
              5[0-5]
            )|
            6(?:
              0[0-7]|
              2[236-9]|
              [35]\d
            )|
            7(?:
              [27]\d|
              8[7-9]
            )|
            8(?:
              [23689]\d|
              7[1-9]
            )|
            9(?:
              [025]\d|
              6[0-246-8]|
              7[0-36-9]|
              8[238]
            )
          )\d{4}
        </nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="[5-8],11"/>
        <exampleNumber>90012345678</exampleNumber>
        <nationalNumberPattern>
          900(?:
            [0-24-9]\d{7}|
            3\d{1,4}
          )
        </nationalNumberPattern>
      </premiumRate>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>81123456</exampleNumber>
        <nationalNumberPattern>
          8(?:
            1[0-4679]\d|
            2(?:
              [0-36]\d|
              7[0-4]
            )|
            3(?:
              [034]\d|
              2[09]|
              70
            )
          )\d{4}
        </nationalNumberPattern>
      </personalNumber>
      <!-- These are mentioned as Access Codes in the ITU doc however UAN seems to be the best
           since they seem to cost the same as fixed-line based on our correspondence with ofca,
           and are used by businesses to forward to a local number. -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>30161234</exampleNumber>
        <nationalNumberPattern>
          30(?:
            0[1-9]|
            [15-7]\d|
            2[047]|
            89
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Honduras (HN) -->
    <!-- It seems there is no longer a trunk prefix in use, based on websites like
         http://www.howtocallabroad.com/codes.html and on seeing how locals write their numbers in
         national format. -->
    <!-- http://www.itu.int/oth/T020200005F/en -->
    <territory id="HN" countryCode="504" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[237-9]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})(\d{4})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          8\d{10}|
          [237-9]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="11"/>
        <nationalNumberPattern>8002\d{7}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- Extra prefixes 2244, 226[24], 227[0135689], 228X, 2292, 2407, 250[78], 2516, 2540,
           256[014], 2570, 2580, 260X, 2617, 262[067], 263[04], 2780 and 2791 were added from numbers
           found online and user reports. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22123456</exampleNumber>
        <nationalNumberPattern>
          2(?:
            2(?:
              0[0-59]|
              1[1-9]|
              [23]\d|
              4[02-6]|
              5[57]|
              6[245]|
              7[0135689]|
              8[01346-9]|
              9[0-2]
            )|
            4(?:
              0[578]|
              2[3-59]|
              3[13-9]|
              4[0-68]|
              5[1-3589]
            )|
            5(?:
              0[2357-9]|
              1[1-356]|
              4[03-5]|
              5\d|
              6[014-69]|
              7[04]|
              80
            )|
            6(?:
              [056]\d|
              17|
              2[067]|
              3[047]|
              4[0-378]|
              [78][0-8]|
              9[01]
            )|
            7(?:
              0[5-79]|
              6[46-9]|
              7[02-9]|
              8[034]|
              91
            )|
            8(?:
              79|
              8[0-357-9]|
              9[1-57-9]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>91234567</exampleNumber>
        <nationalNumberPattern>[37-9]\d{7}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="11"/>
        <exampleNumber>80021234567</exampleNumber>
        <nationalNumberPattern>8002\d{7}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Croatia (HR) -->
    <!-- http://www.itu.int/oth/T0202000032/en -->
    <!-- http://en.wikipedia.org/wiki/%2B385 -->
    <territory id="HR" countryCode="385" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- For 6 and 7 digit numbers of premium rate. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>6[01]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- The plan says 1 XXX XXXX but the government and local telecom websites are formatted 1
             XXXX XXX, so we prefer that formatting here. These same sources prefer XXX XXX to XX
             XXXX as well. -->
        <numberFormat pattern="(\d)(\d{4})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 8 and 9 digit numbers of premium, personal and UAN numbers. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            6|
            7[245]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 8 and 9 digit numbers of mobile. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-57]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [24-69]\d|
            3[0-79]
          )\d{7}|
          80\d{5,7}|
          [1-79]\d{7}|
          6\d{5,6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8,9" localOnly="6,7"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          1\d{7}|
          (?:
            2[0-3]|
            3[1-5]|
            4[02-47-9]|
            5[1-3]
          )\d{6,7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8,9"/>
        <exampleNumber>921234567</exampleNumber>
        <nationalNumberPattern>
          9(?:
            (?:
              0[1-9]|
              [12589]\d
            )\d\d|
            7(?:
              [0679]\d\d|
              5(?:
                [01]\d|
                44|
                55|
                77|
                9[5-7]
              )
            )
          )\d{4}|
          98\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[7-9]"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>80\d{5,7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="[6-8]"/>
        <exampleNumber>611234</exampleNumber>
        <nationalNumberPattern>
          6[01459]\d{6}|
          6[01]\d{4,5}
        </nationalNumberPattern>
      </premiumRate>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>74123456</exampleNumber>
        <nationalNumberPattern>7[45]\d{6}</nationalNumberPattern>
      </personalNumber>
      <!-- ITU numbering specifies the length of the numbers with prefix 62 as 8, but there
           are numbers on the internet with 7 digits after the prefix too. -->
      <uan>
        <possibleLengths national="8,9"/>
        <exampleNumber>62123456</exampleNumber>
        <nationalNumberPattern>
          62\d{6,7}|
          72\d{6}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Haiti (HT) -->
    <!-- http://www.itu.int/oth/T020200005E/en -->
    <!-- http://www.numberingplans.com/ -->
    <territory id="HT" countryCode="509" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{4})">
          <leadingDigits>[2-589]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-489]\d|
            55
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Digicel reported 281 and 29[149] belong to them, the more recent ITU doc 20.I.2017
           agrees and classifies them as fixedLine so we follow that here. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22453300</exampleNumber>
        <nationalNumberPattern>
          2(?:
            2\d|
            5[1-5]|
            81|
            9[149]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 32, 33, 35 are kept even though they are not in the ITU doc because numbers found
           online are working. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>34101234</exampleNumber>
        <nationalNumberPattern>
          (?:
            [34]\d|
            55
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- ITU document says numbers with prefix 8 are "value-added services and free numbers
           without making any further distinction. However, http://www.numberingplans.com/ seems
           to suggest they are free. -->
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>8\d{7}</nationalNumberPattern>
      </tollFree>
      <!-- ITU document suggests 98\d{6}, but http://www.numberingplans.com/ restricts it to
           98[89]\d{5}. -->
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>98901234</exampleNumber>
        <nationalNumberPattern>
          9(?:
            [67][0-4]|
            8[0-3589]|
            9\d
          )\d{5}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Hungary (HU) -->
    <!-- http://www.itu.int/oth/T0202000061/en -->
    <!-- As per Wikipedia https://en.wikipedia.org/wiki/Telephone_numbers_in_Hungary format
         for both fixed line and mobile number should be preceded with national prefix "06". -->
    <territory id="HU" countryCode="36" internationalPrefix="00" nationalPrefix="06"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="($NP $FG)">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="($NP $FG)">
          <leadingDigits>
            [27][2-9]|
            3[2-7]|
            4[24-9]|
            5[2-79]|
            6|
            8[2-57-9]|
            9[2-69]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [235-7]\d{8}|
          [1-9]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="8,9"/>
        <nationalNumberPattern>
          (?:
            [48]0\d|
            680[29]
          )\d{5}
        </nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="8" localOnly="6,7"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            1\d|
            [27][2-9]|
            3[2-7]|
            4[24-9]|
            5[2-79]|
            6[23689]|
            8[2-57-9]|
            9[2-69]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>201234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            [257]0|
            3[01]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- The prefix 40 which was earlier sharedcost is changed to toll free as of Jul. 2016.
           Toll free prefix 6802 supported based on user report. -->
      <tollFree>
        <possibleLengths national="8,9"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            [48]0\d|
            680[29]
          )\d{5}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>9[01]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- Includes non-geographic nomadic numbers. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>211234567</exampleNumber>
        <nationalNumberPattern>21\d{7}</nationalNumberPattern>
      </voip>
      <!-- Includes numbers for corporate networks. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>381234567</exampleNumber>
        <nationalNumberPattern>38\d{7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Indonesia (ID) -->
    <!-- From 2001, very out of date. -->
    <!-- http://www.itu.int/oth/T0202000064/en -->
    <!-- http://en.wikipedia.org/wiki/%2B62 -->
    <territory id="ID" countryCode="62" internationalPrefix="00[89]" nationalPrefix="0">
      <availableFormats>
        <!-- Short UAN numbers -->
        <numberFormat pattern="(\d)(\d{3})(\d{3})">
          <leadingDigits>15</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line 2-digit area codes -->
        <numberFormat pattern="(\d{2})(\d{5,9})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2[124]|
            [36]1
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- http://en.wikipedia.org/wiki/Toll-free_telephone_number, and examples on the web show
             that sometimes they are followed by fewer digits. -->
        <numberFormat pattern="(\d{3})(\d{5,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>800</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed line 3-digit area codes -->
        <numberFormat pattern="(\d{3})(\d{5,8})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>[2-79]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 9-10 digit mobile numbers -->
        <numberFormat pattern="(\d{3})(\d{3,4})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8[1-35-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Toll free numbers -->
        <numberFormat pattern="(\d{3})(\d{6,8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Shared cost numbers -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>804</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- UAN and premium rate numbers -->
        <numberFormat pattern="(\d{3})(\d)(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>80</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- 11-12 digit mobile numbers -->
        <numberFormat pattern="(\d{3})(\d{4})(\d{4,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- 12 digit toll free numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{3})">
          <leadingDigits>001</leadingDigits>
          <format>$1 $2 $3 $4</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Format for 13 digit ITFS numbers. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{3})(\d{4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3 $4</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            (?:
              00[1-9]|
              8\d
            )\d{4}|
            [1-36]
          )\d{6}|
          00\d{10}|
          [1-9]\d{8,10}|
          [2-9]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 00798 ITFS numbers can't be dialled internationally. Source:
           https://support.twilio.com/hc/en-us/articles/115007579027-Toll-free-phone-number-restrictions-and-limitations -->
      <noInternationalDialling>
        <possibleLengths national="10,12,13"/>
        <nationalNumberPattern>
          001803\d{6,7}|
          (?:
            007803\d|
            8071
          )\d{6}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- Area codes taken from wikipedia, with missing ones added from
           http://www.telkom.co.id/customer-services/area-and-country-code/?type=area.
           We also added 0770 after user feedback because it seems to be used on Bintan island.
           Where known, fixed mobile prefixes have been represented as Mobile. -->
      <!-- Very short (5/6 digit) local numbers in Jakarta seem to be special cases for various
           well known companies (Mc Donalds, KFC etc...). Some of these are listed in:
           http://cms.binus.edu/datapage/file/io/Spring2014SE/International_Student_Handbook_BINUS.pdf
           There seem to be numbers of this length for area code 22 as well based on numbers found
           online. -->
      <!-- The ITU doc is outdated (2001), and many numbers of different lengths were supported
           here based on valid numbers found and user report. -->
      <fixedLine>
        <possibleLengths national="[7-11]" localOnly="5,6"/>
        <exampleNumber>218350123</exampleNumber>
        <nationalNumberPattern>
          2[124]\d{7,8}|
          619\d{8}|
          2(?:
            1(?:
              14|
              500
            )|
            2\d{3}
          )\d{3}|
          61\d{5,8}|
          (?:
            2(?:
              [35][1-4]|
              6[0-8]|
              7[1-6]|
              8\d|
              9[1-8]
            )|
            3(?:
              1|
              [25][1-8]|
              3[1-68]|
              4[1-3]|
              6[1-3568]|
              7[0-469]|
              8\d
            )|
            4(?:
              0[1-589]|
              1[01347-9]|
              2[0-36-8]|
              3[0-24-68]|
              43|
              5[1-378]|
              6[1-5]|
              7[134]|
              8[1245]
            )|
            5(?:
              1[1-35-9]|
              2[25-8]|
              3[124-9]|
              4[1-3589]|
              5[1-46]|
              6[1-8]
            )|
            6(?:
              [25]\d|
              3[1-69]|
              4[1-6]
            )|
            7(?:
              02|
              [125][1-9]|
              [36]\d|
              4[1-8]|
              7[0-36-9]
            )|
            9(?:
              0[12]|
              1[013-8]|
              2[0-479]|
              5[125-8]|
              6[23679]|
              7[159]|
              8[01346]
            )
          )\d{5,8}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="[9-12]"/>
        <exampleNumber>812345678</exampleNumber>
        <nationalNumberPattern>8[1-35-9]\d{7,10}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[8-13]"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          00[17]803\d{7}|
          (?:
            177\d|
            800
          )\d{5,7}|
          001803\d{6}
        </nationalNumberPattern>
      </tollFree>
      <!-- The information below is provided by an Indonesian -->
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>8091234567</exampleNumber>
        <nationalNumberPattern>809\d{7}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="10"/>
        <exampleNumber>8041234567</exampleNumber>
        <nationalNumberPattern>804\d{7}</nationalNumberPattern>
      </sharedCost>
      <uan>
        <possibleLengths national="7,10"/>
        <exampleNumber>8071123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            1500|
            8071\d{3}
          )\d{3}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Ireland (IE) -->
    <!-- http://www.comreg.ie/licensing_and_services/numbering_plan_for_ireland.552.440.html -->
    <!-- http://www.comreg.ie/_fileupload/publications/ComReg1119.pdf -->
    <territory id="IE" countryCode="353" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2[24-9]|
            47|
            58|
            6[237-9]|
            9[35-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>[45]0</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3,4})(\d{4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            [2569]|
            4[1-69]|
            7[14]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>70</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>81</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[78]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>4</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Voicemail numbers: same as mobile prefixes but the third digit is always 5. Formatting
             done like this to differentiate from mobile numbers (which are shorter), and based on
             a couple of examples found online. -->
        <numberFormat pattern="(\d{2})(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1\d|
            [2569]
          )\d{6,8}|
          4\d{6,9}|
          7\d{8}|
          8\d{8,9}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="10"/>
        <nationalNumberPattern>18[59]0\d{6}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- We allow 6-7 digit subscriber numbers for the 021 area code since that seems to be
           reflected by the numbers in the Yellow Pages. Another peculiarity is that 048 actually
           replaces 00 44 28 when Irish people dial, allowing them to easily dial Northern
           Ireland. We support these numbers here, although technically they are numbers for the
           UK. -->
      <fixedLine>
        <possibleLengths national="[7-10]" localOnly="5,6"/>
        <exampleNumber>2212345</exampleNumber>
        <nationalNumberPattern>
          (?:
            1\d|
            21
          )\d{6,7}|
          (?:
            2[24-9]|
            4(?:
              0[24]|
              5\d|
              7
            )|
            5(?:
              0[45]|
              1\d|
              8
            )|
            6(?:
              1\d|
              [237-9]
            )|
            9(?:
              1\d|
              [35-9]
            )
          )\d{5}|
          (?:
            23|
            4(?:
              [1-469]|
              8\d
            )|
            5[23679]|
            6[4-6]|
            7[14]|
            9[04]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>850123456</exampleNumber>
        <nationalNumberPattern>
          8(?:
            22|
            [35-9]\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>1800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>1520123456</exampleNumber>
        <nationalNumberPattern>
          15(?:
            1[2-8]|
            [2-8]0|
            9[089]
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="10"/>
        <exampleNumber>1850123456</exampleNumber>
        <nationalNumberPattern>18[59]0\d{6}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>700123456</exampleNumber>
        <nationalNumberPattern>700\d{6}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>761234567</exampleNumber>
        <nationalNumberPattern>76\d{7}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>818123456</exampleNumber>
        <nationalNumberPattern>818\d{6}</nationalNumberPattern>
      </uan>
      <!-- These start with mobile prefixes, and then have the digit 5 inserted, before the rest
           of the number. -->
      <voicemail>
        <possibleLengths national="10"/>
        <exampleNumber>8551234567</exampleNumber>
        <nationalNumberPattern>
          88210[1-9]\d{4}|
          8(?:
            [35-79]5\d\d|
            8(?:
              [013-9]\d\d|
              2(?:
                [01][1-9]|
                [2-9]\d
              )
            )
          )\d{5}
        </nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Israel (IL) -->
    <!-- Formatting practice following wikipedia, and government sites. -->
    <!-- in Hebrew -->
    <!-- http://www.itu.int/oth/T020200006A/en -->
    <!-- http://en.wikipedia.org/wiki/%2B972 -->
    <!-- http://he.wikipedia.org/wiki/%D7%A7%D7%99%D7%93%D7%95%D7%9E%D7%AA_%D7%98%D7%9C%D7%A4%D7%95%D7%9F_%D7%91%D7%99%D7%A9%D7%A8%D7%90%D7%9C -->
    <territory id="IL" countryCode="972" internationalPrefix="0(?:0|1[2-9])" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Short toll-free numbers (for hospitals). -->
        <numberFormat pattern="(\d{4})(\d{3})">
          <leadingDigits>125</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- 8-digit premium rate. -->
        <numberFormat pattern="(\d{4})(\d{2})(\d{2})">
          <leadingDigits>121</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Fixed line. -->
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-489]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Mobile and VOIP. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[57]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- 10-digit premium rate. -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>12</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Universal access (UAN). -->
        <numberFormat pattern="(\d{4})(\d{6})">
          <leadingDigits>159</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- Variable cost (premium rate, toll free etc.) -->
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{3})">
          <leadingDigits>1[7-9]</leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
        <!-- Format is from http://everything.explained.today/Telephone_numbers_in_Israel/
             These seem to be "mailbox" services where you dial "service prefix" + "personal ID"
             (maybe a phone number) which is why they are formatted as two separate numbers.
             Note that 153 prefix might be an M2M number (it's listed as a "fax box" service). -->
        <numberFormat pattern="(\d{3})(\d{1,2})(\d{3})(\d{4})">
          <leadingDigits>15</leadingDigits>
          <format>$1-$2 $3-$4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1\d{6}(?:
            \d{3,5}
          )?|
          [57]\d{8}|
          [1-489]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="10"/>
        <nationalNumberPattern>1700\d{6}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- ITU doc states that 153 + NDC (either mobile or fixed-line) + SN corresponds to fax
           mail. As we do not have separate a fax category, fixedLine is the closest match and
           consistent with some other countries. For maintainability, only NDC lengths are
           mentioned: one digit for fixed-line and two for mobile as per ITU. -->
      <fixedLine>
        <possibleLengths national="8,11,12" localOnly="7"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>
          153\d{8,9}|
          29[1-9]\d{5}|
          (?:
            2[0-8]|
            [3489]\d
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- The ITU document has only some of these prefixes - wikipedia lists more. We are fairly
           sure wikipedia is accurate based on news coverage of the launch of these numbers. Also
           added 5570, 5571, and 5594 prefixes based on confirmations from the carriers. 559[23]
           ranges belong to Telzar carrier as per confirmation from them. Prefix 5527 is added
           based on user report. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>502345678</exampleNumber>
        <nationalNumberPattern>
          55410\d{4}|
          5(?:
            (?:
              [02][02-9]|
              [149][2-9]|
              [36]\d|
              8[3-7]
            )\d|
            5(?:
              01|
              2\d|
              3[0-3]|
              4[34]|
              5[0-25689]|
              6[6-8]|
              7[0-267]|
              8[7-9]|
              9[1-9]
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Online 1-809 numbers now classify themselves as "toll-free". -->
      <tollFree>
        <possibleLengths national="7,10"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          1(?:
            255|
            80[019]\d{3}
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <!-- Peculiarly, one source states that 1956 and 1957 are the new premium rate prefixes.
           However, no online numbers starting with these prefixes can be found, and this data
           is not found in any other source. -->
      <!-- 1200 and 1212 numbers are for televoting. -->
      <premiumRate>
        <possibleLengths national="8,10"/>
        <exampleNumber>1919123456</exampleNumber>
        <nationalNumberPattern>
          1212\d{4}|
          1(?:
            200|
            9(?:
              0[0-2]|
              19
            )
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="10"/>
        <exampleNumber>1700123456</exampleNumber>
        <nationalNumberPattern>1700\d{6}</nationalNumberPattern>
      </sharedCost>
      <!-- These rules are a union of the wikipedia and ITU document prefixes. They are mostly
           marked as VoIP on wikipedia, but it seems they may indeed be DID (Direct Inward
           Dialing) numbers, that most people forward to VoIP numbers. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>771234567</exampleNumber>
        <nationalNumberPattern>
          7(?:
            38(?:
              0\d|
              5[09]|
              88
            )|
            8(?:
              33|
              55|
              77|
              81
            )\d
          )\d{4}|
          7(?:
            18|
            2[23]|
            3[237]|
            47|
            6[258]|
            7\d|
            82|
            9[2-9]
          )\d{6}
        </nationalNumberPattern>
      </voip>
      <!-- 1-599 numbers are actually labelled "interactive voicemail" in the ITU document, but
           according to reports from businesses in Israel and the Hebrew version of the wikipedia
           page, these are actually a router for business calls, and incur a normal call cost on
           account of the caller. -->
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>1599123456</exampleNumber>
        <nationalNumberPattern>1599\d{6}</nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="11,12"/>
        <exampleNumber>15112340000</exampleNumber>
        <nationalNumberPattern>151\d{8,9}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Isle of Man (IM) -->
    <!-- Calling code and formatting shared with 'GB' -->
    <!-- Note that the numbers are fine-grained where needed in order to disambiguate between the
         4 regions i.e UK, Isle of Man, Jersey and Guernsey. -->
    <!-- http://static.ofcom.org.uk/static/numbering/ -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom -->
    <territory id="IM" countryCode="44" leadingDigits="74576|(?:16|7[56])24"
               internationalPrefix="00" nationalPrefix="0"
               nationalPrefixForParsing="([25-8]\d{5})$|0" nationalPrefixTransformRule="1624$1">
      <generalDesc>
        <nationalNumberPattern>
          1624\d{6}|
          (?:
            [3578]\d|
            90
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Specific to IM. -->
      <!-- 1624 with 10 digits. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="6"/>
        <exampleNumber>1624756789</exampleNumber>
        <nationalNumberPattern>
          1624(?:
            230|
            [5-8]\d\d
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 7624[0-4689] numbers could be mobile or paging. However, more evidence and example
           numbers show these are mobile in practice. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>7924123456</exampleNumber>
        <nationalNumberPattern>
          76245[06]\d{4}|
          7(?:
            4576|
            [59]24\d|
            624[0-4689]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- 808 162 with 10 digits. -->
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8081624567</exampleNumber>
        <nationalNumberPattern>808162\d{4}</nationalNumberPattern>
      </tollFree>
      <!-- 844 0[49]0 6, 845 624, 870 624, 872 299, 900 624, 901 624, 906 624, 907 624 with 10
           digits. -->
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9016247890</exampleNumber>
        <nationalNumberPattern>
          8(?:
            440[49]06|
            72299\d
          )\d{3}|
          (?:
            8(?:
              45|
              70
            )|
            90[0167]
          )624\d{4}
        </nationalNumberPattern>
      </premiumRate>
      <!-- Other numbers as per GB. -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>7012345678</exampleNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>5612345678</exampleNumber>
        <nationalNumberPattern>56\d{8}</nationalNumberPattern>
      </voip>
      <!-- 308 162, 33d, 344 040 6, 344 090 6, 345 624, 370 624, 372 299, 55 with 10 digits. -->
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>5512345678</exampleNumber>
        <nationalNumberPattern>
          3440[49]06\d{3}|
          (?:
            3(?:
              08162|
              3\d{4}|
              45624|
              7(?:
                0624|
                2299
              )
            )|
            55\d{4}
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- India (IN) -->
    <!-- http://www.itu.int/oth/T0202000063/en -->
    <!-- http://en.wikipedia.org/wiki/%2B91 -->
    <!-- http://www.bsnl.co.in -->
    <!-- http://dq.ndc.bsnl.co.in/bsnl-web/stdSearch.seam -->
    <!-- http://www.dot.gov.in/access-services/allotment-msc-codes -->
    <territory id="IN" countryCode="91" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 7-digit "short" numbers. -->
        <numberFormat pattern="(\d{7})">
          <leadingDigits>575</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 8-digit "short" numbers (optionally diallable with a national prefix). -->
        <numberFormat pattern="(\d{8})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            5(?:
              0|
              2[23]|
              3[03]|
              [67]1|
              88
            )
          </leadingDigits>
          <leadingDigits>
            5(?:
              0|
              2(?:
                21|
                3
              )|
              3(?:
                0|
                3[23]
              )|
              616|
              717|
              888
            )
          </leadingDigits>
          <leadingDigits>
            5(?:
              0|
              2(?:
                21|
                3
              )|
              3(?:
                0|
                3[23]
              )|
              616|
              717|
              8888
            )
          </leadingDigits>
          <format>$1</format>
        </numberFormat>
        <!-- 8,9-digit toll free numbers -->
        <numberFormat pattern="(\d{4})(\d{4,5})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>180</leadingDigits>
          <leadingDigits>1800</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 10 digit UAN numbers -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>140</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 2-digit area codes. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            11|
            2[02]|
            33|
            4[04]|
            79[1-7]|
            80[2-46]
          </leadingDigits>
          <leadingDigits>
            11|
            2[02]|
            33|
            4[04]|
            79(?:
              [1-6]|
              7[19]
            )|
            80(?:
              [2-4]|
              6[0-589]
            )
          </leadingDigits>
          <leadingDigits>
            11|
            2[02]|
            33|
            4[04]|
            79(?:
              [124-6]|
              3(?:
                [02-9]|
                1[0-24-9]
              )|
              7(?:
                1|
                9[1-6]
              )
            )|
            80(?:
              [2-4]|
              6[0-589]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 3-digit area codes. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            1(?:
              2[0-249]|
              3[0-25]|
              4[145]|
              [68]|
              7[1257]
            )|
            2(?:
              1[257]|
              3[013]|
              4[01]|
              5[0137]|
              6[0158]|
              78|
              8[1568]
            )|
            3(?:
              26|
              4[1-3]|
              5[34]|
              6[01489]|
              7[02-46]|
              8[159]
            )|
            4(?:
              1[36]|
              2[1-47]|
              5[12]|
              6[0-26-9]|
              7[0-24-9]|
              8[013-57]|
              9[014-7]
            )|
            5(?:
              1[025]|
              22|
              [36][25]|
              4[28]|
              5[12]|
              [78]1
            )|
            6(?:
              12|
              [2-4]1|
              5[17]|
              6[13]|
              80
            )|
            7(?:
              12|
              3[134]|
              4[47]|
              61|
              88
            )|
            8(?:
              16|
              2[014]|
              3[126]|
              6[136]|
              7[078]|
              8[34]|
              91
            )|
            (?:
              43|
              59|
              75
            )[15]|
            (?:
              1[59]|
              29|
              67|
              72
            )[14]
          </leadingDigits>
          <leadingDigits>
            1(?:
              2[0-24]|
              3[0-25]|
              4[145]|
              [59][14]|
              6[1-9]|
              7[1257]|
              8[1-57-9]
            )|
            2(?:
              1[257]|
              3[013]|
              4[01]|
              5[0137]|
              6[058]|
              78|
              8[1568]|
              9[14]
            )|
            3(?:
              26|
              4[1-3]|
              5[34]|
              6[01489]|
              7[02-46]|
              8[159]
            )|
            4(?:
              1[36]|
              2[1-47]|
              3[15]|
              5[12]|
              6[0-26-9]|
              7[0-24-9]|
              8[013-57]|
              9[014-7]
            )|
            5(?:
              1[025]|
              22|
              [36][25]|
              4[28]|
              [578]1|
              9[15]
            )|
            674|
            7(?:
              (?:
                2[14]|
                3[34]|
                5[15]
              )[2-6]|
              61[346]|
              88[0-8]
            )|
            8(?:
              70[2-6]|
              84[235-7]|
              91[3-7]
            )|
            (?:
              1(?:
                29|
                60|
                8[06]
              )|
              261|
              552|
              6(?:
                12|
                [2-47]1|
                5[17]|
                6[13]|
                80
              )|
              7(?:
                12|
                31|
                4[47]
              )|
              8(?:
                16|
                2[014]|
                3[126]|
                6[136]|
                7[78]|
                83
              )
            )[2-7]
          </leadingDigits>
          <leadingDigits>
            1(?:
              2[0-24]|
              3[0-25]|
              4[145]|
              [59][14]|
              6[1-9]|
              7[1257]|
              8[1-57-9]
            )|
            2(?:
              1[257]|
              3[013]|
              4[01]|
              5[0137]|
              6[058]|
              78|
              8[1568]|
              9[14]
            )|
            3(?:
              26|
              4[1-3]|
              5[34]|
              6[01489]|
              7[02-46]|
              8[159]
            )|
            4(?:
              1[36]|
              2[1-47]|
              3[15]|
              5[12]|
              6[0-26-9]|
              7[0-24-9]|
              8[013-57]|
              9[014-7]
            )|
            5(?:
              1[025]|
              22|
              [36][25]|
              4[28]|
              [578]1|
              9[15]
            )|
            6(?:
              12(?:
                [2-6]|
                7[0-8]
              )|
              74[2-7]
            )|
            7(?:
              (?:
                2[14]|
                5[15]
              )[2-6]|
              3171|
              61[346]|
              88(?:
                [2-7]|
                82
              )
            )|
            8(?:
              70[2-6]|
              84(?:
                [2356]|
                7[19]
              )|
              91(?:
                [3-6]|
                7[19]
              )
            )|
            73[134][2-6]|
            (?:
              74[47]|
              8(?:
                16|
                2[014]|
                3[126]|
                6[136]|
                7[78]|
                83
              )
            )(?:
              [2-6]|
              7[19]
            )|
            (?:
              1(?:
                29|
                60|
                8[06]
              )|
              261|
              552|
              6(?:
                [2-4]1|
                5[17]|
                6[13]|
                7(?:
                  1|
                  4[0189]
                )|
                80
              )|
              7(?:
                12|
                88[01]
              )
            )[2-7]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 4-digit area codes. -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            1(?:
              [2-479]|
              5[0235-9]
            )|
            [2-5]|
            6(?:
              1[1358]|
              2[2457-9]|
              3[2-5]|
              4[235-7]|
              5[2-689]|
              6[24578]|
              7[235689]|
              8[1-6]
            )|
            7(?:
              1[013-9]|
              28|
              3[129]|
              4[1-35689]|
              5[29]|
              6[02-5]|
              70
            )|
            807
          </leadingDigits>
          <leadingDigits>
            1(?:
              [2-479]|
              5[0235-9]
            )|
            [2-5]|
            6(?:
              1[1358]|
              2(?:
                [2457]|
                84|
                95
              )|
              3(?:
                [2-4]|
                55
              )|
              4[235-7]|
              5[2-689]|
              6[24578]|
              7[235689]|
              8[1-6]
            )|
            7(?:
              1(?:
                [013-8]|
                9[6-9]
              )|
              28[6-8]|
              3(?:
                17|
                2[0-49]|
                9[2-57]
              )|
              4(?:
                1[2-4]|
                [29][0-7]|
                3[0-8]|
                [56]|
                8[0-24-7]
              )|
              5(?:
                2[1-3]|
                9[0-6]
              )|
              6(?:
                0[5689]|
                2[5-9]|
                3[02-8]|
                4|
                5[0-367]
              )|
              70[13-7]
            )|
            807[19]
          </leadingDigits>
          <leadingDigits>
            1(?:
              [2-479]|
              5(?:
                [0236-9]|
                5[013-9]
              )
            )|
            [2-5]|
            6(?:
              2(?:
                84|
                95
              )|
              355|
              83
            )|
            73179|
            807(?:
              1|
              9[1-3]
            )|
            (?:
              1552|
              6(?:
                1[1358]|
                2[2457]|
                3[2-4]|
                4[235-7]|
                5[2-689]|
                6[24578]|
                7[235689]|
                8[124-6]
              )\d|
              7(?:
                1(?:
                  [013-8]\d|
                  9[6-9]
                )|
                28[6-8]|
                3(?:
                  2[0-49]|
                  9[2-57]
                )|
                4(?:
                  1[2-4]|
                  [29][0-7]|
                  3[0-8]|
                  [56]\d|
                  8[0-24-7]
                )|
                5(?:
                  2[1-3]|
                  9[0-6]
                )|
                6(?:
                  0[5689]|
                  2[5-9]|
                  3[02-8]|
                  4\d|
                  5[0-367]
                )|
                70[13-7]
              )
            )[2-7]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile format (this can include some fixed-line ranges due to limited precision
             in some ranges). -->
        <numberFormat pattern="(\d{5})(\d{5})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[6-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 10-12 digit toll free and shared cost numbers. -->
        <numberFormat pattern="(\d{4})(\d{2,4})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            1(?:
              6|
              8[06]
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              6|
              8[06]0
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 13-digit ITFS -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3 $4</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 13 digit toll free and premium rate numbers -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})(\d{3})"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>18</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            000800|
            [2-9]\d\d
          )\d{7}|
          1\d{7,12}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="[8-13]"/>
        <nationalNumberPattern>
          1(?:
            600\d{6}|
            800\d{4,9}
          )|
          (?:
            000800|
            18(?:
              03\d\d|
              6(?:
                0|
                [12]\d\d
              )
            )
          )\d{7}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- This pattern has 3 parts: 2-digit NDCs, 3-digit NDCs, and 4-digit NDCs. This is because
           the subscriber number following NDCs always begins with the operator codes 2-7. Not all
           operator codes are available in all NDCs, but we don't maintain that level of
           granularity. 4-digit NDCs are only maintained up to 3-digit granularity, unless more is
           needed to disambiguate from e.g. mobile ranges. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="[6-8]"/>
        <exampleNumber>7410410123</exampleNumber>
        <nationalNumberPattern>
          2717(?:
            [2-7]\d|
            95
          )\d{4}|
          (?:
            271[0-689]|
            782[0-6]
          )[2-7]\d{5}|
          (?:
            170[24]|
            2(?:
              (?:
                [02][2-79]|
                90
              )\d|
              80[13468]
            )|
            (?:
              3(?:
                23|
                80
              )|
              683|
              79[1-7]
            )\d|
            4(?:
              20[24]|
              72[2-8]
            )|
            552[1-7]
          )\d{6}|
          (?:
            11|
            33|
            4[04]|
            80
          )[2-7]\d{7}|
          (?:
            342|
            674|
            788
          )(?:
            [0189][2-7]|
            [2-7]\d
          )\d{5}|
          (?:
            1(?:
              2[0-249]|
              3[0-25]|
              4[145]|
              [59][14]|
              6[014]|
              7[1257]|
              8[01346]
            )|
            2(?:
              1[257]|
              3[013]|
              4[01]|
              5[0137]|
              6[0158]|
              78|
              8[1568]|
              9[14]
            )|
            3(?:
              26|
              4[13]|
              5[34]|
              6[01489]|
              7[02-46]|
              8[159]
            )|
            4(?:
              1[36]|
              2[1-47]|
              3[15]|
              5[12]|
              6[0-26-9]|
              7[014-9]|
              8[013-57]|
              9[014-7]
            )|
            5(?:
              1[025]|
              22|
              [36][25]|
              4[28]|
              [578]1|
              9[15]
            )|
            6(?:
              12|
              [2-47]1|
              5[17]|
              6[13]|
              80
            )|
            7(?:
              12|
              2[14]|
              3[134]|
              4[47]|
              5[15]|
              [67]1
            )|
            8(?:
              16|
              2[014]|
              3[126]|
              6[136]|
              7[078]|
              8[34]|
              91
            )
          )[2-7]\d{6}|
          (?:
            1(?:
              2[35-8]|
              3[346-9]|
              4[236-9]|
              [59][0235-9]|
              6[235-9]|
              7[34689]|
              8[257-9]
            )|
            2(?:
              1[134689]|
              3[24-8]|
              4[2-8]|
              5[25689]|
              6[2-4679]|
              7[3-79]|
              8[2-479]|
              9[235-9]
            )|
            3(?:
              01|
              1[79]|
              2[1245]|
              4[5-8]|
              5[125689]|
              6[235-7]|
              7[157-9]|
              8[2-46-8]
            )|
            4(?:
              1[14578]|
              2[5689]|
              3[2-467]|
              5[4-7]|
              6[35]|
              73|
              8[2689]|
              9[2389]
            )|
            5(?:
              [16][146-9]|
              2[14-8]|
              3[1346]|
              4[14-69]|
              5[46]|
              7[2-4]|
              8[2-8]|
              9[246]
            )|
            6(?:
              1[1358]|
              2[2457]|
              3[2-4]|
              4[235-7]|
              5[2-689]|
              6[24578]|
              7[235689]|
              8[124-6]
            )|
            7(?:
              1[013-9]|
              2[0235-9]|
              3[2679]|
              4[1-35689]|
              5[2-46-9]|
              [67][02-9]|
              8[013-7]|
              9[089]
            )|
            8(?:
              1[1357-9]|
              2[235-8]|
              3[03-57-9]|
              4[0-24-9]|
              5\d|
              6[2457-9]|
              7[1-6]|
              8[1256]|
              9[2-4]
            )
          )\d[2-7]\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- http://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India -->
      <!-- The document titled "List of MSC codes" linked off
           http://www.dot.gov.in/access-services/national-numbering-plan-2003 was helpful but last
           updated 2012 - more updates at http://www.dot.gov.in/access-services/allotment-msc-codes. -->
      <!-- A couple of additional prefixes found neither on the wikipedia page nor in the MSC
           codes list, are added because SMS messages have been successfully sent to these
           numbers. It seems almost impossible to know for some of these numbers whether they are
           land-line or mobile, since the ranges overlap. We go to a maximum depth of five where
           necessary to distinguish between mobile and fixed-line numbers. Extra prefixes added:
           6391, 7317[2-4], 7601, 768[56][1-7], 7695, 81145, 83178, 83287 and 83678. New prefixes
           were also added based on the document provided from mobile carriers:
           https://github.com/google/libphonenumber/issues/260 and
           https://github.com/google/libphonenumber/pull/692/ -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>8123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            61279|
            7(?:
              887[02-9]|
              9(?:
                313|
                79[07-9]
              )
            )|
            8(?:
              079[04-9]|
              (?:
                84|
                91
              )7[02-8]
            )
          )\d{5}|
          (?:
            6(?:
              12|
              [2-47]1|
              5[17]|
              6[13]|
              80
            )[0189]|
            7(?:
              1(?:
                2[0189]|
                9[0-5]
              )|
              2(?:
                [14][017-9]|
                8[0-59]
              )|
              3(?:
                2[5-8]|
                [34][017-9]|
                9[016-9]
              )|
              4(?:
                1[015-9]|
                [29][89]|
                39|
                8[389]
              )|
              5(?:
                [15][017-9]|
                2[04-9]|
                9[7-9]
              )|
              6(?:
                0[0-47]|
                1[0-257-9]|
                2[0-4]|
                3[19]|
                5[4589]
              )|
              70[0289]|
              88[089]|
              97[02-8]
            )|
            8(?:
              0(?:
                6[67]|
                7[02-8]
              )|
              70[017-9]|
              84[01489]|
              91[0-289]
            )
          )\d{6}|
          (?:
            7(?:
              31|
              4[47]
            )|
            8(?:
              16|
              2[014]|
              3[126]|
              6[136]|
              7[78]|
              83
            )
          )(?:
            [0189]\d|
            7[02-8]
          )\d{5}|
          (?:
            6(?:
              [09]\d|
              1[04679]|
              2[03689]|
              3[05-9]|
              4[0489]|
              50|
              6[069]|
              7[07]|
              8[7-9]
            )|
            7(?:
              0\d|
              2[0235-79]|
              3[05-8]|
              40|
              5[0346-8]|
              6[6-9]|
              7[1-9]|
              8[0-79]|
              9[089]
            )|
            8(?:
              0[01589]|
              1[0-57-9]|
              2[235-9]|
              3[03-57-9]|
              [45]\d|
              6[02457-9]|
              7[1-69]|
              8[0-25-9]|
              9[02-9]
            )|
            9\d\d
          )\d{7}|
          (?:
            6(?:
              (?:
                1[1358]|
                2[2457]|
                3[2-4]|
                4[235-7]|
                5[2-689]|
                6[24578]|
                8[124-6]
              )\d|
              7(?:
                [235689]\d|
                4[0189]
              )
            )|
            7(?:
              1(?:
                [013-8]\d|
                9[6-9]
              )|
              28[6-8]|
              3(?:
                2[0-49]|
                9[2-5]
              )|
              4(?:
                1[2-4]|
                [29][0-7]|
                3[0-8]|
                [56]\d|
                8[0-24-7]
              )|
              5(?:
                2[1-3]|
                9[0-6]
              )|
              6(?:
                0[5689]|
                2[5-9]|
                3[02-8]|
                4\d|
                5[0-367]
              )|
              70[13-7]|
              881
            )
          )[0189]\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Information gathered from sites such as
           http://www.surfindia.com/india-facts/toll-free-no.html and
           http://indmusings.blogspot.com/2008/09/free-help-line-numbersindia.html
           http://www.bsnl.co.in/service/telev.htm -->
      <tollFree>
        <possibleLengths national="[8-13]"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          000800\d{7}|
          1(?:
            600\d{6}|
            80(?:
              0\d{4,9}|
              3\d{9}
            )
          )
        </nationalNumberPattern>
      </tollFree>
      <!-- Only televoting numbers are covered here for now. The 900 numbers are not covered
           because they overlap with mobile, and we haven't found any real numbers online.
           1863 424 Tele-voting (Different Charge Rate) numbers are not added as there are no
           valid numbers online. -->
      <premiumRate>
        <possibleLengths national="13"/>
        <exampleNumber>1861123456789</exampleNumber>
        <nationalNumberPattern>186[12]\d{9}</nationalNumberPattern>
      </premiumRate>
      <!-- While described as "universal numbers" in the numbering plan, evidence suggests
           that 1860 number are best described as shared cost. See "Call Local Service" in:
           http://www.tatadocomo.com/corporates/toll-free.aspx -->
      <sharedCost>
        <possibleLengths national="11"/>
        <exampleNumber>18603451234</exampleNumber>
        <nationalNumberPattern>1860\d{7}</nationalNumberPattern>
      </sharedCost>
      <!-- Telemarketing numbers: http://en.wikipedia.org/wiki/Telephone_numbers_in_India. 1869 -
           long distance UAN numbers are not added here as there are no valid numbers online. -->
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>1409305260</exampleNumber>
        <nationalNumberPattern>140\d{7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- British Indian Ocean Territory (IO) -->
    <!-- http://www.itu.int/oth/T0202000039/en -->
    <territory id="IO" countryCode="246" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>3\d{6}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>3709100</exampleNumber>
        <nationalNumberPattern>37\d{5}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>3801234</exampleNumber>
        <nationalNumberPattern>38\d{5}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Iraq (IQ) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- https://www.itu.int/oth/T0202000067/en -->
    <!-- http://en.wikipedia.org/wiki/%2B964 -->
    <!-- http://wtng.info/wtng-964-ik.html -->
    <territory id="IQ" countryCode="964" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-6]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1|
            7\d\d
          )\d{7}|
          [2-6]\d{7,8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8,9" localOnly="6,7"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          1\d{7}|
          (?:
            2[13-5]|
            3[02367]|
            4[023]|
            5[03]|
            6[026]
          )\d{6,7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>7912345678</exampleNumber>
        <nationalNumberPattern>7[3-9]\d{8}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Iran (IR) -->
    <!-- http://en.wikipedia.org/wiki/%2B98 -->
    <!-- http://www.itu.int/oth/T0202000066/en -->
    <!-- http://www.tct.ir/?siteid=1&pageid=195 -->
    <!-- http://118.tct.ir/citycode.htm -->
    <!-- Prefix 9950 is mentioned as Public trunk with variable length 5 to 10 digits in ITU doc.
         As we are unaware of the exact usage of this range and no online references we are not
         adding it. -->
    <territory id="IR" countryCode="98" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Format for short UAN numbers 096XX and 096XXX (we only need this format so the
             national prefix formatting rule is inherited properly). -->
        <numberFormat pattern="(\d{4,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>96</leadingDigits>
          <format>$1</format>
        </numberFormat>
        <!-- Older 6-7 length fixed line ranges. -->
        <numberFormat pattern="(\d{2})(\d{4,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              1[137]|
              2[13-68]|
              3[1458]|
              4[145]|
              5[1468]|
              6[16]|
              7[1467]|
              8[13467]
            )[12689]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Non-geographical number (mobile and some fixed line ranges). -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 10-digit fixed line (formatting follows wikipedia). -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-8]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-9]\d{9}|
          (?:
            [1-8]\d\d|
            9
          )\d{3,4}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="4,5,10"/>
        <nationalNumberPattern>
          9(?:
            4440\d{5}|
            6(?:
              0[12]|
              2[16-8]|
              3(?:
                08|
                [14]5|
                [23]|
                66
              )|
              4(?:
                0|
                80
              )|
              5[01]|
              6[89]|
              86|
              9[19]
            )
          )
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- In Summer 2014 Iran unified all fixed phone numbers in the following way:
           Each province is assigned a two digit prefix.
           Within each province, all numbers are exactly eight digits.  The expression below is
           mostly organized by province.  For each province we accept all eight-digit combinations
           and according to the ITU communication of 21.VI.2016, 94000 and 942 are also fixed-line
           prefixes, but not area codes.

           11 Mazandaran
           13 Gilan
           17 Golestan
           21 Tehran
           23 Semnan
           24 Zanjan
           25 Qom
           26 Alborz
           28 Qazvin
           31 Isfahan
           34 Kerman
           35 Yazd
           38 Chahar Mahaal and Bakhtiari
           41 East Azerbaijan
           44 West Azerbaijan
           45 Ardabil
           51 Razavi Khorasan
           54 Sistan and Baluchestan
           56 South Khorasan
           58 North Khorasan
           61 Khuzestan
           66 Lorestan
           71 Fars
           74 Kohgiluyeh and Boyer-Ahmad
           76 Hormozgan
           77 Bushehr
           81 Hamadan
           83 Kermanshah
           84 Ilam
           86 Markazi
           87 Kurdistan
           As per user reports and test results [16]\d{3} and [289]\d{3,4} shortcodes can be
           dialled by prefixing area codes. ITU mentions the length of Fixed Phone numbers are of
           5 to 10 digits. However, no valid numbers were found online are less than 10 digits,
           so there's only support for 10 digits. ITU mentions multiple "Fixed Phone"
           categories called "Fixed wireless Access" and "Fixed Non geographical" along with plain
           "Fixed Phone" with geocoding details. As no more details are provided, they are
           supported as fixed-line numbers. -->
      <fixedLine>
        <possibleLengths national="6,7,10" localOnly="4,5,8"/>
        <exampleNumber>2123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[137]|
            2[13-68]|
            3[1458]|
            4[145]|
            5[1468]|
            6[16]|
            7[1467]|
            8[13467]
          )(?:
            [03-57]\d{7}|
            [16]\d{3}(?:
              \d{4}
            )?|
            [289]\d{3}(?:
              \d(?:
                \d{3}
              )?
            )?
          )|
          94(?:
            000[09]|
            (?:
              12\d|
              30[0-2]
            )\d|
            2(?:
              121|
              [2689]0\d
            )|
            4(?:
              111|
              40\d
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 992 prefix is been supported based on user report. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>9123456789</exampleNumber>
        <nationalNumberPattern>
          9(?:
            (?:
              0(?:
                [0-35]\d|
                4[4-6]
              )|
              (?:
                [13]\d|
                2[0-3]
              )\d
            )\d|
            9(?:
              [0-46]\d\d|
              5[15]0|
              8(?:
                [12]\d|
                88
              )|
              9(?:
                0[0-3]|
                [19]\d|
                21|
                69|
                77|
                8[7-9]
              )
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- UAN ranges from http://118.tct.ir/necnum.htm ("096" numbers are not shortcodes since
           they require the national prefix). -->
      <uan>
        <possibleLengths national="4,5"/>
        <exampleNumber>9601</exampleNumber>
        <nationalNumberPattern>
          96(?:
            0[12]|
            2[16-8]|
            3(?:
              08|
              [14]5|
              [23]|
              66
            )|
            4(?:
              0|
              80
            )|
            5[01]|
            6[89]|
            86|
            9[19]
          )
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Iceland (IS) -->
    <!-- http://www.pta.is/default.aspx?cat_id=85 -->
    <!-- http://www.pfs.is/default.aspx?cat_id=14&module_id=210&element_id=4 -->
    <!-- http://www.pfs.is/english/telecom-affairs/numbering/ -->
    <territory id="IS" countryCode="354" preferredInternationalPrefix="00"
               internationalPrefix="00|1(?:0(?:01|[12]0)|100)" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[4-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            38\d|
            [4-9]
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Including 87[23] XXXX here as it is listed as a fax number. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>4101234</exampleNumber>
        <nationalNumberPattern>
          (?:
            4(?:
              1[0-24-69]|
              2[0-7]|
              [37][0-8]|
              4[0-24589]|
              5[0-68]|
              6\d|
              8[0-36-8]
            )|
            5(?:
              05|
              [156]\d|
              2[02578]|
              3[0-579]|
              4[03-7]|
              7[0-2578]|
              8[0-35-9]|
              9[013-689]
            )|
            872
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- TETRA = TErrestrial Trunked RAdio is included under mobile. -->
      <mobile>
        <possibleLengths national="7,9"/>
        <exampleNumber>6111234</exampleNumber>
        <nationalNumberPattern>
          (?:
            38[589]\d\d|
            6(?:
              1[1-8]|
              2[0-6]|
              3[026-9]|
              4[014679]|
              5[0159]|
              6[0-69]|
              70|
              8[06-8]|
              9\d
            )|
            7(?:
              5[057]|
              [6-9]\d
            )|
            8(?:
              2[0-59]|
              [3-69]\d|
              8[238]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- The UIFN numbers mentioned in the Excel document are not yet included since no real
           numbers can be found online, and it is not clear what these are; the standard
           definition would have them under the +800 country code instead of Iceland. -->
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>80[0-8]\d{4}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>9001234</exampleNumber>
        <nationalNumberPattern>
          90(?:
            0\d|
            1[5-79]|
            2[015-79]|
            3[135-79]|
            4[125-7]|
            5[25-79]|
            7[1-37]|
            8[0-35-7]
          )\d{3}
        </nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>4921234</exampleNumber>
        <nationalNumberPattern>49[0-24-79]\d{4}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="7"/>
        <exampleNumber>8091234</exampleNumber>
        <nationalNumberPattern>809\d{4}</nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="7"/>
        <exampleNumber>6891234</exampleNumber>
        <nationalNumberPattern>
          (?:
            689|
            8(?:
              7[18]|
              80
            )|
            95[48]
          )\d{4}
        </nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Italy (IT) -->
    <!-- Main region for 'VA' -->
    <!-- http://en.wikipedia.org/wiki/%2B39 -->
    <!-- https://www.agcom.it/piano-di-numerazione -->
    <territory id="IT" mainCountryForCode="true" countryCode="39" internationalPrefix="00"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Shortcodes (4-5 digits). -->
        <numberFormat pattern="(\d{4,5})">
          <leadingDigits>
            1(?:
              0|
              9[246]
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              0|
              9(?:
                2[2-9]|
                [46]
              )
            )
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Shortcodes (6 digits). -->
        <numberFormat pattern="(\d{6})">
          <leadingDigits>
            1(?:
              1|
              92
            )
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4,6})">
          <leadingDigits>0[26]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3,6})">
          <leadingDigits>
            0[13-57-9][0159]|
            8(?:
              03|
              4[17]|
              9[2-5]
            )
          </leadingDigits>
          <leadingDigits>
            0[13-57-9][0159]|
            8(?:
              03|
              4[17]|
              9(?:
                2|
                3[04]|
                [45][0-4]
              )
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2,6})">
          <leadingDigits>
            0(?:
              [13-579][2-46-8]|
              8[236-8]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>894</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- The leading zero for fixed numbers will be prepended before the matching of these
             regular expressions. -->
        <numberFormat pattern="(\d{2})(\d{3,4})(\d{4})">
          <leadingDigits>
            0[26]|
            5
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})">
          <leadingDigits>
            1(?:
              44|
              [679]
            )|
            [378]|
            43
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3,4})(\d{4})">
          <leadingDigits>
            0[13-57-9][0159]|
            14
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{5})">
          <leadingDigits>0[26]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})(\d{4,5})">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          0\d{5,10}|
          1\d{8,10}|
          3(?:
            [0-8]\d{7,10}|
            9\d{7,8}
          )|
          (?:
            43|
            55|
            70
          )\d{8}|
          8\d{5}(?:
            \d{2,4}
          )?
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="9"/>
        <nationalNumberPattern>848\d{6}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- Maximum lengths in the ITU document are 10, but it states above that for numbers
           starting with 01, the maximum length is in fact 11. In fact, online, numbers can be
           found with other prefixes that are 11 digits long as well, so we allow it for all the
           three and four digit area codes. -->
      <fixedLine>
        <possibleLengths national="[6-11]"/>
        <exampleNumber>0212345678</exampleNumber>
        <nationalNumberPattern>
          0669[0-79]\d{1,6}|
          0(?:
            1(?:
              [0159]\d|
              [27][1-5]|
              31|
              4[1-4]|
              6[1356]|
              8[2-57]
            )|
            2\d\d|
            3(?:
              [0159]\d|
              2[1-4]|
              3[12]|
              [48][1-6]|
              6[2-59]|
              7[1-7]
            )|
            4(?:
              [0159]\d|
              [23][1-9]|
              4[245]|
              6[1-5]|
              7[1-4]|
              81
            )|
            5(?:
              [0159]\d|
              2[1-5]|
              3[2-6]|
              4[1-79]|
              6[4-6]|
              7[1-578]|
              8[3-8]
            )|
            6(?:
              [0-57-9]\d|
              6[0-8]
            )|
            7(?:
              [0159]\d|
              2[12]|
              3[1-7]|
              4[2-46]|
              6[13569]|
              7[13-6]|
              8[1-59]
            )|
            8(?:
              [0159]\d|
              2[3-578]|
              3[1-356]|
              [6-8][1-5]
            )|
            9(?:
              [0159]\d|
              [238][1-5]|
              4[12]|
              6[1-8]|
              7[1-6]
            )
          )\d{2,7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- User reported the existence of new 11 digit long numbers for TIM with the prefix 33X, so
           it is also supported.
           Prefix 43 is 10 digits long and is used for SMS Application To
           Person (A2P) for OTP, marketing, etc -->
      <mobile>
        <possibleLengths national="9,10"/>
        <exampleNumber>3123456789</exampleNumber>
        <nationalNumberPattern>
          3[2-9]\d{7,8}|
          (?:
            31|
            43
          )\d{8}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="6,9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>
          80(?:
            0\d{3}|
            3
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <!-- Adding 0878 numbers, as per
           http://www.aduc.it/notizia/polizia+mette+allerta+sul+numero+0878_73136.php. Other
           premium prefixes are mentioned here:
           http://www.dirittodellinformatica.it/news/telefonia/agcom-blocco-permanente-prefissi-144-166-892-899-20080520241.html -->
      <premiumRate>
        <possibleLengths national="6,[8-10]"/>
        <exampleNumber>899123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            0878\d{3}|
            89(?:
              2\d|
              3[04]|
              4(?:
                [0-4]|
                [5-9]\d\d
              )|
              5[0-4]
            )
          )\d\d|
          (?:
            1(?:
              44|
              6[346]
            )|
            89(?:
              38|
              5[5-9]|
              9
            )
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="6,9"/>
        <exampleNumber>848123456</exampleNumber>
        <nationalNumberPattern>
          84(?:
            [08]\d{3}|
            [17]
          )\d{3}
        </nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9,10"/>
        <exampleNumber>1781234567</exampleNumber>
        <nationalNumberPattern>
          1(?:
            78\d|
            99
          )\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>5512345678</exampleNumber>
        <nationalNumberPattern>55\d{8}</nationalNumberPattern>
      </voip>
      <voicemail>
        <possibleLengths national="11,12"/>
        <exampleNumber>33101234501</exampleNumber>
        <nationalNumberPattern>3[2-8]\d{9,10}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Jersey (JE) -->
    <!-- Calling code and formatting shared with 'GB' -->
    <!-- Note that the numbers are fine-grained where needed in order to disambiguate between the
         4 regions i.e UK, Isle of Man, Jersey and Guernsey. -->
    <!-- http://static.ofcom.org.uk/static/numbering/ -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Kingdom -->
    <!-- http://www.jcra.je/cms3/v2/public/cmsChild.asp?pageID=1024&childID=1036 -->
    <territory id="JE" countryCode="44" internationalPrefix="00" nationalPrefix="0"
               nationalPrefixForParsing="([0-24-8]\d{5})$|0" nationalPrefixTransformRule="1534$1">
      <generalDesc>
        <nationalNumberPattern>
          1534\d{6}|
          (?:
            [3578]\d|
            90
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Specific to JE. -->
      <!-- 1534 with 10 digits. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="6"/>
        <exampleNumber>1534456789</exampleNumber>
        <nationalNumberPattern>1534[0-24-8]\d{5}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>7797712345</exampleNumber>
        <nationalNumberPattern>
          7(?:
            (?:
              (?:
                50|
                82
              )9|
              937
            )\d|
            7(?:
              00[378]|
              97\d
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Pager numbers as per GB. -->
      <pager>
        <possibleLengths national="10"/>
        <exampleNumber>7640123456</exampleNumber>
        <nationalNumberPattern>
          76(?:
            464|
            652
          )\d{5}|
          76(?:
            0[0-28]|
            2[356]|
            34|
            4[01347]|
            5[49]|
            6[0-369]|
            77|
            8[14]|
            9[139]
          )\d{6}
        </nationalNumberPattern>
      </pager>
      <!-- Specific to JE. -->
      <!-- 800 735, 800 781, 808 901 with 10 digits. -->
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8007354567</exampleNumber>
        <nationalNumberPattern>
          80(?:
            07(?:
              35|
              81
            )|
            8901
          )\d{4}
        </nationalNumberPattern>
      </tollFree>
      <!-- 844 405, 844 442, 844 469, 844 703, 845 041, 845 800, 870 002, 871 206, 900 665, 900 669,
           901 810, 907 107, 907 155 with 10 digits. -->
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9018105678</exampleNumber>
        <nationalNumberPattern>
          (?:
            8(?:
              4(?:
                4(?:
                  4(?:
                    05|
                    42|
                    69
                  )|
                  703
                )|
                5(?:
                  041|
                  800
                )
              )|
              7(?:
                0002|
                1206
              )
            )|
            90(?:
              066[59]|
              1810|
              71(?:
                07|
                55
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
      <!-- 70 1511 with 10 digits. -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>7015115678</exampleNumber>
        <nationalNumberPattern>701511\d{4}</nationalNumberPattern>
      </personalNumber>
      <!-- VoIP numbers as per GB. -->
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>5612345678</exampleNumber>
        <nationalNumberPattern>56\d{8}</nationalNumberPattern>
      </voip>
      <!-- 300 735, 300 781, 308 901, 33d, 344 405, 344 442, 344 469, 344 703, 345 041, 345 800,
           370 002, 371 206, 55 with 10 digits. -->
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>5512345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              0(?:
                07(?:
                  35|
                  81
                )|
                8901
              )|
              3\d{4}|
              4(?:
                4(?:
                  4(?:
                    05|
                    42|
                    69
                  )|
                  703
                )|
                5(?:
                  041|
                  800
                )
              )|
              7(?:
                0002|
                1206
              )
            )|
            55\d{4}
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Jamaica (JM) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T020200006C/en -->
    <territory id="JM" countryCode="1" leadingDigits="658|876" internationalPrefix="011"
               nationalPrefix="1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            658|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Numbers have been found online for ranges 613, 62x, 63x, 656, 66[2-589]. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8765230123</exampleNumber>
        <nationalNumberPattern>
          8766060\d{3}|
          (?:
            658(?:
              2(?:
                [0-8]\d|
                9[0-46-9]
              )|
              [3-9]\d\d
            )|
            876(?:
              52[35]|
              6(?:
                0[1-3579]|
                1[0235-9]|
                [23]\d|
                40|
                5[06]|
                6[2-589]|
                7[0-25-9]|
                8[04]|
                9[4-9]
              )|
              7(?:
                0[2-689]|
                [1-6]\d|
                8[056]|
                9[45]
              )|
              9(?:
                0[1-8]|
                1[02378]|
                [2-8]\d|
                9[2-468]
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 27, 28, 299, 31, 508 and 566 as extra prefixes, as they have been found to be
           valid by sending SMSs and looking at online number lookup sites. Numbers have been
           found online for the following ranges 258, 26x, 29x, 53x, 54x, 55x, 56x. Most have
           mobile numbers online so we have put them under mobile but is possible they are a
           mixture of fixed line and mobile. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8762101234</exampleNumber>
        <nationalNumberPattern>
          (?:
            658295|
            876(?:
              2(?:
                0[1-9]|
                [13-9]\d|
                2[013-9]
              )|
              [348]\d\d|
              5(?:
                0[1-9]|
                [1-9]\d
              )|
              6(?:
                4[89]|
                6[67]
              )|
              7(?:
                0[07]|
                7\d|
                8[1-47-9]|
                9[0-36-9]
              )|
              9(?:
                [01]9|
                9[0579]
              )
            )
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Jordan (JO) -->
    <!-- http://www.trc.gov.jo/images/stories/pdf/NNP_ver200[1].pdf?lang=english -->
    <!-- http://www.itu.int/oth/T020200006E/en -->
    <!-- http://en.wikipedia.org/wiki/%2B962 -->
    <territory id="JO" countryCode="962" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            [2356]|
            87
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{5,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>70</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            (?:
              [2689]|
              7\d
            )\d|
            32|
            53
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>62001234</exampleNumber>
        <nationalNumberPattern>
          87(?:
            000|
            90[01]
          )\d{3}|
          (?:
            2(?:
              6(?:
                2[0-35-9]|
                3[0-578]|
                4[24-7]|
                5[0-24-8]|
                [6-8][023]|
                9[0-3]
              )|
              7(?:
                0[1-79]|
                10|
                2[014-7]|
                3[0-689]|
                4[019]|
                5[0-3578]
              )
            )|
            32(?:
              0[1-69]|
              1[1-35-7]|
              2[024-7]|
              3\d|
              4[0-3]|
              [5-7][023]
            )|
            53(?:
              0[0-3]|
              [13][023]|
              2[0-59]|
              49|
              5[0-35-9]|
              6[15]|
              7[45]|
              8[1-6]|
              9[0-36-9]
            )|
            6(?:
              2(?:
                [05]0|
                22
              )|
              3(?:
                00|
                33
              )|
              4(?:
                0[0-25]|
                1[2-7]|
                2[0569]|
                [38][07-9]|
                4[025689]|
                6[0-589]|
                7\d|
                9[0-2]
              )|
              5(?:
                [01][056]|
                2[034]|
                3[0-57-9]|
                4[178]|
                5[0-69]|
                6[0-35-9]|
                7[1-379]|
                8[0-68]|
                9[0239]
              )
            )|
            87(?:
              20|
              7[078]|
              99
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>790123456</exampleNumber>
        <nationalNumberPattern>
          7(?:
            [78][0-25-9]|
            9\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="9"/>
        <exampleNumber>746612345</exampleNumber>
        <nationalNumberPattern>
          74(?:
            66|
            77
          )\d{5}
        </nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>80\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90012345</exampleNumber>
        <nationalNumberPattern>9\d{7}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>85012345</exampleNumber>
        <nationalNumberPattern>85\d{6}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>700123456</exampleNumber>
        <nationalNumberPattern>70\d{7}</nationalNumberPattern>
      </personalNumber>
      <!-- These numbers are Location Independent Services / Fixed cost according to
           http://www.trc.gov.jo -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>88101234</exampleNumber>
        <nationalNumberPattern>
          8(?:
            10|
            8\d
          )\d{5}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Japan (JP) -->
    <!-- http://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/number_shitei.html -->
    <!-- https://www.itu.int/oth/T020200006D/en -->
    <!-- http://www.numberingplans.com/?page=dialling&sub=areacodes&ac=JP -->
    <!-- nationalPrefixTransformRule is used here for purpose of capturing 0005999999 kind of
         short codes without dropping intial '0' as national prefix. As we are using this field, the
         library is unable to capture domestic carrier codes used, example input:
         003768-0XX-YYYY-ZZZZ. Due to historic reasons, the parts that we captured in
         nationalPrefixTransform rule can either be used to transform or to capture in fields like
         preferred_domestic_carrier_code; schema is designed this way. -->
    <territory id="JP" countryCode="81" internationalPrefix="010" nationalPrefix="0"
               nationalPrefixForParsing="(000[259]\d{6})$|(?:(?:003768)0?)|0"
               nationalPrefixTransformRule="$1" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- National-only toll-free numbers (0037, 0066, 0077 and 0088). -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>007</leadingDigits>
          <leadingDigits>0077</leadingDigits>
          <leadingDigits>00777</leadingDigits>
          <leadingDigits>00777[01]</leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Toll-free, premium-rate and UAN numbers -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              12|
              57|
              99
            )0
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d)(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              26|
              3[79]|
              4[56]|
              5[4-68]|
              6[3-5]
            )|
            499|
            5(?:
              76|
              97
            )|
            746|
            8(?:
              3[89]|
              47|
              51
            )|
            9(?:
              80|
              9[16]
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              267|
              3(?:
                7[247]|
                9[278]
              )|
              466|
              5(?:
                47|
                58|
                64
              )|
              6(?:
                3[245]|
                48|
                5[4-68]
              )
            )|
            499[2468]|
            5(?:
              76|
              97
            )9|
            7468|
            8(?:
              3(?:
                8[7-9]|
                96
              )|
              477|
              51[2-9]
            )|
            9(?:
              802|
              9(?:
                1[23]|
                69
              )
            )|
            1(?:
              45|
              58
            )[67]
          </leadingDigits>
          <leadingDigits>
            1(?:
              267|
              3(?:
                7[247]|
                9[278]
              )|
              466|
              5(?:
                47|
                58|
                64
              )|
              6(?:
                3[245]|
                48|
                5[4-68]
              )
            )|
            499[2468]|
            5(?:
              769|
              979[2-69]
            )|
            7468|
            8(?:
              3(?:
                8[7-9]|
                96[2457-9]
              )|
              477|
              51[2-9]
            )|
            9(?:
              802|
              9(?:
                1[23]|
                69
              )
            )|
            1(?:
              45|
              58
            )[67]
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>60</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [36]|
            4(?:
              2[09]|
              7[01]
            )
          </leadingDigits>
          <leadingDigits>
            [36]|
            4(?:
              2(?:
                0|
                9[02-69]
              )|
              7(?:
                0[019]|
                1
              )
            )
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              1|
              5[45]|
              77|
              88|
              9[69]
            )|
            2(?:
              2[1-37]|
              3[0-269]|
              4[59]|
              5|
              6[24]|
              7[1-358]|
              8[1369]|
              9[0-38]
            )|
            4(?:
              [28][1-9]|
              3[0-57]|
              [45]|
              6[248]|
              7[2-579]|
              9[29]
            )|
            5(?:
              2|
              3[0459]|
              4[0-369]|
              5[29]|
              8[02389]|
              9[0-389]
            )|
            7(?:
              2[02-46-9]|
              34|
              [58]|
              6[0249]|
              7[57]|
              9[2-6]
            )|
            8(?:
              2[124589]|
              3[26-9]|
              49|
              51|
              6|
              7[0-468]|
              8[68]|
              9[019]
            )|
            9(?:
              [23][1-9]|
              4[15]|
              5[138]|
              6[1-3]|
              7[156]|
              8[189]|
              9[1-489]
            )
          </leadingDigits>
          <leadingDigits>
            1(?:
              1|
              5(?:
                4[018]|
                5[017]
              )|
              77|
              88|
              9[69]
            )|
            2(?:
              2(?:
                [127]|
                3[014-9]
              )|
              3[0-269]|
              4[59]|
              5(?:
                [1-3]|
                5[0-69]|
                9[19]
              )|
              62|
              7(?:
                [1-35]|
                8[0189]
              )|
              8(?:
                [16]|
                3[0134]|
                9[0-5]
              )|
              9(?:
                [028]|
                17
              )
            )|
            4(?:
              2(?:
                [13-79]|
                8[014-6]
              )|
              3[0-57]|
              [45]|
              6[248]|
              7[2-47]|
              8[1-9]|
              9[29]
            )|
            5(?:
              2|
              3(?:
                [045]|
                9[0-8]
              )|
              4[0-369]|
              5[29]|
              8[02389]|
              9[0-3]
            )|
            7(?:
              2[02-46-9]|
              34|
              [58]|
              6[0249]|
              7[57]|
              9(?:
                [23]|
                4[0-59]|
                5[01569]|
                6[0167]
              )
            )|
            8(?:
              2(?:
                [1258]|
                4[0-39]|
                9[0-2469]
              )|
              3(?:
                [29]|
                60
              )|
              49|
              51|
              6(?:
                [0-24]|
                36|
                5[0-3589]|
                7[23]|
                9[01459]
              )|
              7[0-468]|
              8[68]
            )|
            9(?:
              [23][1-9]|
              4[15]|
              5[138]|
              6[1-3]|
              7[156]|
              8[189]|
              9(?:
                [1289]|
                3[34]|
                4[0178]
              )
            )|
            (?:
              264|
              837
            )[016-9]|
            2(?:
              57|
              93
            )[015-9]|
            (?:
              25[0468]|
              422|
              838
            )[01]|
            (?:
              47[59]|
              59[89]|
              8(?:
                6[68]|
                9
              )
            )[019]
          </leadingDigits>
          <leadingDigits>
            1(?:
              1|
              5(?:
                4[018]|
                5[017]
              )|
              77|
              88|
              9[69]
            )|
            2(?:
              2[127]|
              3[0-269]|
              4[59]|
              5(?:
                [1-3]|
                5[0-69]|
                9(?:
                  17|
                  99
                )
              )|
              6(?:
                2|
                4[016-9]
              )|
              7(?:
                [1-35]|
                8[0189]
              )|
              8(?:
                [16]|
                3[0134]|
                9[0-5]
              )|
              9(?:
                [028]|
                17
              )
            )|
            4(?:
              2(?:
                [13-79]|
                8[014-6]
              )|
              3[0-57]|
              [45]|
              6[248]|
              7[2-47]|
              9[29]
            )|
            5(?:
              2|
              3(?:
                [045]|
                9(?:
                  [0-58]|
                  6[4-9]|
                  7[0-35689]
                )
              )|
              4[0-369]|
              5[29]|
              8[02389]|
              9[0-3]
            )|
            7(?:
              2[02-46-9]|
              34|
              [58]|
              6[0249]|
              7[57]|
              9(?:
                [23]|
                4[0-59]|
                5[01569]|
                6[0167]
              )
            )|
            8(?:
              2(?:
                [1258]|
                4[0-39]|
                9[0169]
              )|
              3(?:
                [29]|
                60|
                7(?:
                  [017-9]|
                  6[6-8]
                )
              )|
              49|
              51|
              6(?:
                [0-24]|
                36[2-57-9]|
                5(?:
                  [0-389]|
                  5[23]
                )|
                6(?:
                  [01]|
                  9[178]
                )|
                7(?:
                  2[2-468]|
                  3[78]
                )|
                9[0145]
              )|
              7[0-468]|
              8[68]
            )|
            9(?:
              4[15]|
              5[138]|
              7[156]|
              8[189]|
              9(?:
                [1289]|
                3(?:
                  31|
                  4[357]
                )|
                4[0178]
              )
            )|
            (?:
              8294|
              96
            )[1-3]|
            2(?:
              57|
              93
            )[015-9]|
            (?:
              223|
              8699
            )[014-9]|
            (?:
              25[0468]|
              422|
              838
            )[01]|
            (?:
              48|
              8292|
              9[23]
            )[1-9]|
            (?:
              47[59]|
              59[89]|
              8(?:
                68|
                9
              )
            )[019]
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [14]|
            [289][2-9]|
            5[3-9]|
            7[2-4679]
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{3,4})">
          <leadingDigits>007</leadingDigits>
          <leadingDigits>0077</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{4})">
          <leadingDigits>008</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>800</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[257-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3,4})">
          <leadingDigits>0</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})(\d{4,5})">
          <leadingDigits>0</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{5})(\d{5,6})">
          <leadingDigits>0</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{6})(\d{6,7})">
          <leadingDigits>0</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          00[1-9]\d{6,14}|
          [257-9]\d{9}|
          (?:
            00|
            [1-9]\d\d
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Toll-free numbers with a leading "00" cannot be dialled internationally. -->
      <noInternationalDialling>
        <possibleLengths national="[8-17]"/>
        <nationalNumberPattern>
          00(?:
            777(?:
              [01]|
              (?:
                5|
                8\d
              )\d
            )|
            882[1245]\d\d
          )\d\d|
          00(?:
            37|
            66|
            78
          )\d{6,13}
        </nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>312345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              1[235-8]|
              2[3-6]|
              3[3-9]|
              4[2-6]|
              [58][2-8]|
              6[2-7]|
              7[2-9]|
              9[1-9]
            )|
            (?:
              2[2-9]|
              [36][1-9]
            )\d|
            4(?:
              [2-578]\d|
              6[02-8]|
              9[2-59]
            )|
            5(?:
              [2-589]\d|
              6[1-9]|
              7[2-8]
            )|
            7(?:
              [25-9]\d|
              3[4-9]|
              4[02-9]
            )|
            8(?:
              [2679]\d|
              3[2-9]|
              4[5-9]|
              5[1-9]|
              8[03-9]
            )|
            9(?:
              [2-58]\d|
              [679][1-9]
            )
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>9012345678</exampleNumber>
        <nationalNumberPattern>[7-9]0[1-9]\d{7}</nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="10"/>
        <exampleNumber>2012345678</exampleNumber>
        <nationalNumberPattern>20\d{8}</nationalNumberPattern>
      </pager>
      <!-- http://www.kddi.com/english/business/free_call_dx/number.html and
           http://tm.softbank.jp/english/business/phone_service/freecall_sp/index.html
           http://eonet.jp/home/denwa/service/access.html
           http://ci.fusioncom.co.jp/feature/
           http://www.auhikari.jp/service/tel/connection/index.html -->
      <!-- Note that in fact, the number length for 0037 and 0066 numbers should extend to 21
           digits, confirmed with Yahoo JP. However, this extends well beyond the maximum number
           length allowed by ITU and hence our library, so we only allow numbers up to 17 digits
           for now (including both leading 00s). -->
      <tollFree>
        <possibleLengths national="[8-17]"/>
        <exampleNumber>120123456</exampleNumber>
        <nationalNumberPattern>
          00777(?:
            [01]|
            5\d
          )\d\d|
          (?:
            00(?:
              7778|
              882[1245]
            )|
            (?:
              120|
              800\d
            )\d\d
          )\d{4}|
          00(?:
            37|
            66|
            78
          )\d{6,13}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>990123456</exampleNumber>
        <nationalNumberPattern>990\d{6}</nationalNumberPattern>
      </premiumRate>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>601234567</exampleNumber>
        <nationalNumberPattern>60\d{7}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>5012345678</exampleNumber>
        <nationalNumberPattern>50[1-9]\d{7}</nationalNumberPattern>
      </voip>
      <!-- Storing "unified number service" as UAN. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>570123456</exampleNumber>
        <nationalNumberPattern>570\d{6}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Kenya (KE) -->
    <!-- http://www.ca.go.ke/index.php/numbering -->
    <!-- https://www.itu.int/oth/T0202000070/en -->
    <!-- http://en.wikipedia.org/wiki/+254 -->
    <territory id="KE" countryCode="254" internationalPrefix="000" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{5,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[24-6]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[17]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [17]\d\d|
            900
          )\d{6}|
          (?:
            2|
            80
          )0\d{6,7}|
          [4-6]\d{6,8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The prefixes 046, 050, 058, and 066 may appear online in less than 9 digits but
           calling them has confirmed these are outdated. However a 7-digit 068 number was
           dialed successfully so we consider these valid despite the plan. Range 65 is still
           supported based on ca.go.ke's doc even though its not mentioned in ITU doc. -->
      <fixedLine>
        <possibleLengths national="[7-9]"/>
        <exampleNumber>202012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            4[245]|
            5[1-79]|
            6[01457-9]
          )\d{5,7}|
          (?:
            4[136]|
            5[08]|
            62
          )\d{7}|
          (?:
            [24]0|
            66
          )\d{6,7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Per www.ca.go.ke range 1\d{8} is mobile. The range has not been assigned to an operator
           yet and no working numbers were found online. Not adding the range for now.
           As per Communication authority of Kenya range 10[0-2] is assigned to "Airtel" and 11[01]
           is assigned to "Safaricom". -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>712123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              0[0-6]|
              1[0-5]|
              2[014]|
              30
            )|
            7\d\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Longer numbers have been found than the plan suggests, so we support them here too. -->
      <!-- The plan suggests 0844 and 0845 may belong here, but these are short numbers rather
           than prefixes:
           http://www.telkomkenya.8k.com/Products/v/2.html
           http://www.kenya-advisor.com/phone-calls-kenya.html
           http://www.telkom.co.ke/index.php?option=com_content&view=article&id=64&Itemid=98 -->
      <tollFree>
        <possibleLengths national="9,10"/>
        <exampleNumber>800223456</exampleNumber>
        <nationalNumberPattern>800[02-8]\d{5,6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900223456</exampleNumber>
        <nationalNumberPattern>900[02-9]\d{5}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Kyrgyzstan (KG) -->
    <!-- No premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T0202000074/en -->
    <territory id="KG" countryCode="996" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            3(?:
              1[346]|
              [24-79]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [235-79]|
            88
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d)(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          8\d{9}|
          [235-9]\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Extra area codes found on Web Search: 3147. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="5,6"/>
        <exampleNumber>312123456</exampleNumber>
        <nationalNumberPattern>
          312(?:
            5[0-79]\d|
            9(?:
              [0-689]\d|
              7[0-24-9]
            )
          )\d{3}|
          (?:
            3(?:
              1(?:
                2[0-46-8]|
                3[1-9]|
                47|
                [56]\d
              )|
              2(?:
                22|
                3[0-479]|
                6[0-7]
              )|
              4(?:
                22|
                5[6-9]|
                6\d
              )|
              5(?:
                22|
                3[4-7]|
                59|
                6\d
              )|
              6(?:
                22|
                5[35-7]|
                6\d
              )|
              7(?:
                22|
                3[468]|
                4[1-9]|
                59|
                [67]\d
              )|
              9(?:
                22|
                4[1-8]|
                6\d
              )
            )|
            6(?:
              09|
              12|
              2[2-4]
            )\d
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>700123456</exampleNumber>
        <nationalNumberPattern>
          312(?:
            58\d|
            973
          )\d{3}|
          (?:
            2(?:
              0[0-35]|
              2\d
            )|
            5[0-24-7]\d|
            600|
            7(?:
              [07]\d|
              55
            )|
            88[08]|
            9(?:
              12|
              9[05-9]
            )
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Add an extra digit to the number pattern since the only toll-free number found on Web
           Search contains 10 digits instead of the 9 digits specified in the ITU document. -->
      <tollFree>
        <possibleLengths national="9,10"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6,7}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Cambodia (KH) -->
    <!-- http://www.itu.int/oth/T0202000023/en -->
    <!-- http://en.wikipedia.org/wiki/+855 -->
    <territory id="KH" countryCode="855" internationalPrefix="00[14-9]" nationalPrefix="0">
      <availableFormats>
        <!-- General format for most number ranges -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Toll-free and premium rate numbers -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1\d{9}|
          [1-9]\d{7,8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Allowing subscriber numbers beginning with 5 since Mobitel have informed us they have
           started issuing fixed-line numbers like this. Apparently, mobile-company-issued
           fixed-line numbers are one digit longer than government-issued numbers. Moreover, the
           range beginning with 6 seems to include some numbers that are one digit longer as well.
           Allowing 238\d{6} and 234[234]\d{4} based on information from Cambodia Yellow Pages.
           Note that numbers beginning with 234 are split across two patterns. -->
      <fixedLine>
        <possibleLengths national="8,9" localOnly="6,7"/>
        <exampleNumber>23756789</exampleNumber>
        <nationalNumberPattern>
          23(?:
            4(?:
              [2-4]|
              [56]\d
            )|
            [568]\d\d
          )\d{4}|
          23[236-9]\d{5}|
          (?:
            2[4-6]|
            3[2-6]|
            4[2-4]|
            [5-7][2-5]
          )(?:
            (?:
              [237-9]|
              4[56]|
              5\d
            )\d{5}|
            6\d{5,6}
          )
        </nationalNumberPattern>
      </fixedLine>
      <!-- SMART uses prefixes 01[056], 070, 08[167] and 09[368].
           Beeline uses 060.
           Mobitel uses 01[1247].
           Cellcard uses 0857 and 061.
           Extra prefixes found online: 088, 097.
           Allowing 9-digit 1[28], 31, 38 and 76 numbers based on information from Cambodia Yellow
           Pages and online search. Allowing 71 based on open-source report and online search. -->
      <mobile>
        <possibleLengths national="8,9"/>
        <exampleNumber>91234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              1[28]|
              3[18]|
              9[67]
            )\d|
            6[016-9]|
            7(?:
              [07-9]|
              [16]\d
            )|
            8(?:
              [013-79]|
              8\d
            )
          )\d{6}|
          (?:
            1\d|
            9[0-57-9]
          )\d{6}|
          (?:
            2[3-6]|
            3[2-6]|
            4[2-4]|
            [5-7][2-5]
          )48\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Adding extra prefix 180021 used by tollfreetc.com.kh. -->
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          1800(?:
            1\d|
            2[019]
          )\d{4}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>1900123456</exampleNumber>
        <nationalNumberPattern>
          1900(?:
            1\d|
            2[09]
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Kiribati (KI) -->
    <!-- We include the national prefix for parsing here just in case numbers can be dialled with a
         leading 0 - no numbers online have been found formatted this way, but the ITU document
         lists it as a national dialling prefix. -->
    <!-- http://www.itu.int/oth/T0202000071/en -->
    <territory id="KI" countryCode="686" internationalPrefix="00" nationalPrefix="0">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [37]\d|
            6[0-79]
          )\d{6}|
          (?:
            [2-48]\d|
            50
          )\d{3}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The 5-digit numbers are in a parallel running period where they transition to 8-digit
           numbers beginning with 7. This period was stated to run between July 1 2016 and July 1
           2018 in the ITU communication of 27.VI.2017, although some numbers may have ended
           transition in 2017, such as 75381xxx which is not present in the communication of
           27.VI.2017, whereas it was in the communication of 1.VIII.2016 where the period was
           stated to end in 2017. -->
      <!-- Granularity for fixedLine numbers prefixed by 6 and 7 is high, to disambiguate between
           them and mobile ranges with equal shorter prefixes. -->
      <fixedLine>
        <possibleLengths national="5,8"/>
        <exampleNumber>31234</exampleNumber>
        <nationalNumberPattern>
          (?:
            [24]\d|
            3[1-9]|
            50|
            65(?:
              02[12]|
              12[56]|
              22[89]|
              [3-5]00
            )|
            7(?:
              27\d\d|
              3100|
              5(?:
                02[12]|
                12[56]|
                22[89]|
                [34](?:
                  00|
                  81
                )|
                500
              )
            )|
            8[0-5]
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>72001234</exampleNumber>
        <nationalNumberPattern>
          (?:
            6200[01]|
            7(?:
              310[1-9]|
              5(?:
                02[03-9]|
                12[0-47-9]|
                22[0-7]|
                [34](?:
                  0[1-9]|
                  8[02-9]
                )|
                50[1-9]
              )
            )
          )\d{3}|
          (?:
            63\d\d|
            7(?:
              (?:
                [0146-9]\d|
                2[0-689]
              )\d|
              3(?:
                [02-9]\d|
                1[1-9]
              )|
              5(?:
                [0-2][013-9]|
                [34][1-79]|
                5[1-9]|
                [6-9]\d
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- ITU refers to these as "Overseas Operator" (used to call Phone Group's usage
           "Telemedia and audiotext"). -->
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>30010000</exampleNumber>
        <nationalNumberPattern>
          30(?:
            0[01]\d\d|
            12(?:
              11|
              20
            )
          )\d\d
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Comoros (KM) -->
    <!-- http://www.itu.int/oth/T020200002D/en -->
    <territory id="KM" countryCode="269" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})">
          <leadingDigits>[3478]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[3478]\d{6}</nationalNumberPattern>
      </generalDesc>
      <!-- CDMA phones are included here, as they are considered as an extension of fixed line:
           http://www.comorestelecom.km/presentationcdma.php -->
      <fixedLine>
        <possibleLengths national="7" localOnly="4"/>
        <exampleNumber>7712345</exampleNumber>
        <nationalNumberPattern>7[4-7]\d{5}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>3212345</exampleNumber>
        <nationalNumberPattern>[34]\d{6}</nationalNumberPattern>
      </mobile>
      <!-- These are referred to as value-added services in the plan and no further information
           can be found. -->
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>8\d{6}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- St. Kitts & Nevis (KN) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000B0/en -->
    <territory id="KN" countryCode="1" leadingDigits="869" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-7]\d{6})$|1"
               nationalPrefixTransformRule="869$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Adding the 869 302 prefix as it is used by Marriott Hotels, even though no other record
           of it can be found. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8692361234</exampleNumber>
        <nationalNumberPattern>
          869(?:
            2(?:
              29|
              36
            )|
            302|
            4(?:
              6[015-9]|
              70
            )|
            56[5-7]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added some more prefixes in the 66 and 76 range from online numbers. -->
      <!-- Example number from the ITU document. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8697652917</exampleNumber>
        <nationalNumberPattern>
          869(?:
            48[89]|
            55[6-8]|
            66\d|
            76[02-7]
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- North Korea (KP) -->
    <!-- http://en.wikipedia.org/wiki/%2B850 -->
    <territory id="KP" countryCode="850" internationalPrefix="00|99" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-7]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          85\d{6}|
          (?:
            19\d|
            [2-7]
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- For numbers starting with 2, only the 2381 range can be dialed internationally. -->
      <noInternationalDialling>
        <possibleLengths national="8"/>
        <nationalNumberPattern>
          238[02-9]\d{4}|
          2(?:
            [0-24-9]\d|
            3[0-79]
          )\d{5}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- Covers only numbers from Pyongyang and Rason Economic Special Zone. According to
           wikipedia, other ranges of phone numbers are top secret, unpublished, and not dialable
           from overseas. Also, there is conflicting information about the length of fixed-line
           numbers, so here we are following Wikipedia. -->
      <fixedLine>
        <possibleLengths national="8,10" localOnly="6,7"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              195|
              2
            )\d|
            3[19]|
            4[159]|
            5[37]|
            6[17]|
            7[39]|
            85
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>1921234567</exampleNumber>
        <nationalNumberPattern>19[1-3]\d{7}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- South Korea (KR) -->
    <!-- Exceptions :
         internationalPrefix
             0031, 0033, 0071, 0073 - Special services of KT and DACOM, ignorable.
             Supporting prefixes that are only in use. For prefixes like 003XX and 007XX, the
             service provider can make arbitrary service + numbers.
         nationalPrefix
             1[4-6]XX-YYYY - Country-wide common number services, display as it is without hyphens.
         00798 is an ITFS range. So it doesn't appear here as internationalPrefix. -->
    <!-- http://www.itu.int/oth/T0202000072/en -->
    <!-- http://en.wikipedia.org/wiki/%2B82 -->
    <!-- http://www.kcc.go.kr/user.do?mode=view&page=P02030300&dc=K02030300&boardId=1074&boardSeq=2349 -->
    <!-- http://www.kcc.go.kr/user.do?mode=view&page=P02030300&dc=K02030300&boardId=1074&boardSeq=2240 -->
    <!-- http://www.telecentro.co.kr/sub/index.php?job=detail&ebcf_id=faq&page=1&mid=0503&eb_seq=36 -->
    <territory id="KR" countryCode="82"
               internationalPrefix="00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))"
               nationalPrefix="0" nationalPrefixForParsing="0(8(?:[1-46-8]|5\d\d))?"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Format for 5 digit short codes. -->
        <numberFormat pattern="(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1[016-9]1</leadingDigits>
          <leadingDigits>1[016-9]11</leadingDigits>
          <leadingDigits>1[016-9]114</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Fixed-line number ranges with 5-6 digits. -->
        <numberFormat pattern="(\d{2})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$NP$CC-$FG">
          <leadingDigits>
            (?:
              3[1-3]|
              [46][1-4]|
              5[1-5]
            )1
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- UAN numbers. -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>1</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- Fixed-line number ranges with 8-9 digits. -->
        <numberFormat pattern="(\d)(\d{3,4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$NP$CC-$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Premium-rate and 9-digit toll-free numbers. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$NP$CC-$FG">
          <leadingDigits>
            60|
            8
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Mobile, pager, and fixed-line number ranges with 9-10 digits. -->
        <numberFormat pattern="(\d{2})(\d{3,4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$NP$CC-$FG">
          <leadingDigits>
            [1346]|
            5[1-5]
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- 10 digit personal and VOIP numbers. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$NP$CC-$FG">
          <leadingDigits>[57]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Toll-free numbers with 11 digits. -->
        <numberFormat pattern="(\d{5})(\d{3})(\d{3})">
          <leadingDigits>003</leadingDigits>
          <leadingDigits>0030</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- 11 digit personal numbers. -->
        <numberFormat pattern="(\d{2})(\d{5})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$NP$CC-$FG">
          <leadingDigits>5</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Toll-free numbers with 12-13 digits. -->
        <numberFormat pattern="(\d{5})(\d{3,4})(\d{4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Toll-free numbers with 14 digits. -->
        <numberFormat pattern="(\d{5})(\d{2})(\d{3})(\d{4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3 $4</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          00[1-9]\d{8,11}|
          (?:
            [12]|
            5\d{3}
          )\d{7}|
          [13-6]\d{9}|
          (?:
            [1-6]\d|
            80
          )\d{7}|
          [3-6]\d{4,5}|
          (?:
            00|
            7
          )0\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 00798 ITFS numbers can't be dialled internationally. -->
      <!-- Based on online results, supporting 00308 and 00368 toll-free numbers that are
           diallable only within the country. -->
      <noInternationalDialling>
        <possibleLengths national="[11-14]"/>
        <nationalNumberPattern>
          00(?:
            3(?:
              08\d{6,7}|
              68\d{7}
            )|
            798\d{7,9}
          )
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- We omit 049, supposedly for Kaesong Industrial Region, since real numbers can't be
           found, and it is in North Korea anyway. We support 7-8 digits long subscriber numbers
           starting with 1 based on evidence of real numbers found online. Some short codes
           (1\d{2,3}) can be dialled with area codes. So we are supporting them when they are
           prefixed with valid area codes. -->
      <fixedLine>
        <possibleLengths national="5,6,[8-10]" localOnly="3,4,7"/>
        <exampleNumber>22123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            2|
            3[1-3]|
            [46][1-4]|
            5[1-5]
          )[1-9]\d{6,7}|
          (?:
            3[1-3]|
            [46][1-4]|
            5[1-5]
          )1\d{2,3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Prefix 10596 added based on user report -->
      <mobile>
        <possibleLengths national="9,10"/>
        <exampleNumber>1020000000</exampleNumber>
        <nationalNumberPattern>
          1(?:
            05(?:
              [0-8]\d|
              9[0-6]
            )|
            22[13]\d
          )\d{4,5}|
          1(?:
            0[0-46-9]|
            [16-9]\d|
            2[013-9]
          )\d{6,7}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="9,10"/>
        <exampleNumber>1523456789</exampleNumber>
        <nationalNumberPattern>15\d{7,8}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="9,[11-14]"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>
          00(?:
            308\d{6,7}|
            798\d{7,9}
          )|
          (?:
            00368|
            80
          )\d{7}
        </nationalNumberPattern>
      </tollFree>
      <!-- The information below is provided by a Korean person. -->
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>602345678</exampleNumber>
        <nationalNumberPattern>60[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- Supporting 11 digit 50 numbers based on evidence provided by reporter. -->
      <personalNumber>
        <possibleLengths national="10,11"/>
        <exampleNumber>5012345678</exampleNumber>
        <nationalNumberPattern>50\d{8,9}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>7012345678</exampleNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
      </voip>
      <!-- Prefixes 18 and 1522 are added from numbers found online. -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>15441234</exampleNumber>
        <nationalNumberPattern>
          1(?:
            5(?:
              22|
              33|
              44|
              66|
              77|
              88|
              99
            )|
            6(?:
              [07]0|
              44|
              6[0168]|
              88
            )|
            8(?:
              00|
              33|
              55|
              77|
              99
            )
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Kuwait (KW) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T0202000073/en -->
    <territory id="KW" countryCode="965" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Format is from ITU. -->
        <numberFormat pattern="(\d{4})(\d{3,4})">
          <leadingDigits>
            [169]|
            2(?:
              [235]|
              4[1-35-9]
            )|
            52
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{5})">
          <leadingDigits>[245]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          18\d{5}|
          (?:
            [2569]\d|
            41
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22345678</exampleNumber>
        <nationalNumberPattern>
          2(?:
            [23]\d\d|
            4(?:
              [1-35-9]\d|
              44
            )|
            5(?:
              0[034]|
              [2-46]\d|
              5[1-3]|
              7[1-7]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Supported 966[1-9] range based on numbers found online. -->
      <!-- 989X range is mentioned in older (15.IV.2014) ITU doc but it is not mentioned in
           ITU doc dated 5.V.2017. As valid numbers are found online, supporting the range. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>50012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            41\d\d|
            5(?:
              (?:
                [05]\d|
                1[0-7]|
                6[56]
              )\d|
              2(?:
                22|
                5[25]
              )|
              7(?:
                55|
                77
              )|
              88[58]
            )|
            6(?:
              (?:
                0[034679]|
                5[015-9]|
                6\d
              )\d|
              1(?:
                00|
                11|
                6[16]
              )|
              2[26]2|
              3[36]3|
              4[46]4|
              7(?:
                0[013-9]|
                [67]\d
              )|
              8[68]8|
              9(?:
                [069]\d|
                3[039]
              )
            )|
            9(?:
              (?:
                [04679]\d|
                8[057-9]
              )\d|
              1(?:
                1[01]|
                99
              )|
              2(?:
                00|
                2\d
              )|
              3(?:
                00|
                3[03]
              )|
              5(?:
                00|
                5\d
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- 18XX XXX was earlier assigned to Fixedline but the latest ITU Doc and also citra.gov.kw
           confirmed that these are Toll Free numbers. -->
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>1801234</exampleNumber>
        <nationalNumberPattern>18\d{5}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Cayman Islands (KY) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T0202000027/en -->
    <territory id="KY" countryCode="1" leadingDigits="345" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
               nationalPrefixTransformRule="345$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            345|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The 800 NXX code is listed as being "national only", but we successfully reached numbers
           from Switzerland with this prefix so do not list it as noInternationalDialling. -->
      <!-- The Westtel numbers in the plan seem now to be live and assigned to fixed-line phones,
           as per numbers found online and their website http://www.logic.ky. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>3452221234</exampleNumber>
        <nationalNumberPattern>
          345(?:
            2(?:
              22|
              3[23]|
              44|
              66
            )|
            333|
            444|
            6(?:
              23|
              38|
              40
            )|
            7(?:
              30|
              4[35-79]|
              6[6-9]|
              77
            )|
            8(?:
              00|
              1[45]|
              [48]8
            )|
            9(?:
              14|
              4[035-9]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding central office codes 576, 923 and 936 from numbers found online.
           Most central office codes that were surrendered have not been included, with the
           exception of 546 where numbers have been found. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>3453231234</exampleNumber>
        <nationalNumberPattern>
          345(?:
            32[1-9]|
            42[0-4]|
            5(?:
              1[67]|
              2[5-79]|
              4[6-9]|
              50|
              76
            )|
            649|
            82[56]|
            9(?:
              1[679]|
              2[2-9]|
              3[06-9]|
              90
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="10"/>
        <exampleNumber>3458491234</exampleNumber>
        <nationalNumberPattern>345849\d{4}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            345976|
            900[2-9]\d\d
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Kazakhstan (KZ) -->
    <!-- Calling code and formatting shared with 'RU' -->
    <!-- http://www.itu.int/oth/T020200006F/en -->
    <!-- https://telecom.kz/en/catalog/kazahstan.171777/5 -->
    <territory id="KZ" countryCode="7" leadingDigits="33|7" preferredInternationalPrefix="8~10"
               internationalPrefix="810" nationalPrefix="8" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            33622|
            8\d{8}
          )\d{5}|
          [78]\d{9}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="10"/>
        <nationalNumberPattern>751\d{7}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- VSAT numbers are also included here. We also include the area code for Baikonur (336
           22), which is within Kazakhstan but in fact rented and administered by Russia at the
           moment. Added 7279 from numbers found online. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="[5-7]"/>
        <exampleNumber>7123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            33622|
            7(?:
              1(?:
                0(?:
                  [23]\d|
                  4[0-3]|
                  59|
                  63
                )|
                1(?:
                  [23]\d|
                  4[0-79]|
                  59
                )|
                2(?:
                  [23]\d|
                  59
                )|
                3(?:
                  2\d|
                  3[0-79]|
                  4[0-35-9]|
                  59
                )|
                4(?:
                  [24]\d|
                  3[013-9]|
                  5[1-9]|
                  97
                )|
                5(?:
                  2\d|
                  3[1-9]|
                  4[0-7]|
                  59
                )|
                6(?:
                  [2-4]\d|
                  5[19]|
                  61
                )|
                72\d|
                8(?:
                  [27]\d|
                  3[1-46-9]|
                  4[0-5]|
                  59
                )
              )|
              2(?:
                1(?:
                  [23]\d|
                  4[46-9]|
                  5[3469]
                )|
                2(?:
                  2\d|
                  3[0679]|
                  46|
                  5[12679]
                )|
                3(?:
                  [2-4]\d|
                  5[139]
                )|
                4(?:
                  2\d|
                  3[1-35-9]|
                  59
                )|
                5(?:
                  [23]\d|
                  4[0-8]|
                  59|
                  61
                )|
                6(?:
                  2\d|
                  3[1-9]|
                  4[0-4]|
                  59
                )|
                7(?:
                  [2379]\d|
                  40|
                  5[279]
                )|
                8(?:
                  [23]\d|
                  4[0-3]|
                  59
                )|
                9(?:
                  2\d|
                  3[124578]|
                  59
                )
              )
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added 708 for Altel, 776 for Beeline, 747 for Tele2, confirmed by
           https://ru.wikipedia.org/wiki/Телефонный_план_нумерации_Казахстана -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>7710009998</exampleNumber>
        <nationalNumberPattern>
          7(?:
            0[0-25-8]|
            47|
            6[0-4]|
            7[15-8]|
            85
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10,14"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            108\d{3}
          )\d{7}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>8091234567</exampleNumber>
        <nationalNumberPattern>809\d{7}</nationalNumberPattern>
      </premiumRate>
      <!-- These are referred to as UPT numbers in the plan. -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>8081234567</exampleNumber>
        <nationalNumberPattern>808\d{7}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>7511234567</exampleNumber>
        <nationalNumberPattern>751\d{7}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Laos (LA) -->
    <!-- Seems incomplete -->
    <!-- http://www.itu.int/oth/T0202000075/en -->
    <!-- http://en.wikipedia.org/wiki/+856 -->
    <territory id="LA" countryCode="856" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- Format for fixed-line numbers. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            2[13]|
            3[14]|
            [4-8]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for UAN numbers. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>30[013-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Format for mobile numbers. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[23]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [23]\d{9}|
          3\d{8}|
          (?:
            [235-8]\d|
            41
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8" localOnly="6"/>
        <exampleNumber>21212862</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[13]|
            [35-7][14]|
            41|
            8[1468]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 202[89], 205[289], 207[68] and 209[135-7] from numbers found online. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>2023123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            20(?:
              [2359]\d|
              7[6-8]|
              88
            )|
            302\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- The Lonely Planet says that newer WIN phones (fixed phones without a physical landline)
           start with 030. There are plenty of examples online as customer care numbers. As these
           are available accross nation, supporting them as UAN. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>301234567</exampleNumber>
        <nationalNumberPattern>30[013-9]\d{6}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Lebanon (LB) -->
    <!-- http://www.itu.int/oth/T0202000077/en -->
    <!-- http://en.wikipedia.org/wiki/%2B961 -->
    <territory id="LB" countryCode="961" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [13-69]|
            7(?:
              [2-57]|
              62|
              8[0-7]|
              9[04-9]
            )|
            8[02-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
          <leadingDigits>[27-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [27-9]\d{7}|
          [13-9]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7,8"/>
        <exampleNumber>1123456</exampleNumber>
        <nationalNumberPattern>
          7(?:
            62|
            8[0-7]|
            9[04-9]
          )\d{4}|
          (?:
            [14-69]\d|
            2(?:
              [14-69]\d|
              [78][1-9]
            )|
            7[2-57]|
            8[02-9]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- We only validate the first three digits here, since the ranges are growing rapidly.
           The 79[02-9] prefixes were added from bug reports and numbers found online. -->
      <mobile>
        <possibleLengths national="7,8"/>
        <exampleNumber>71123456</exampleNumber>
        <nationalNumberPattern>
          793(?:
            [01]\d|
            2[0-4]
          )\d{3}|
          (?:
            (?:
              3|
              81
            )\d|
            7(?:
              [01]\d|
              6[013-9]|
              8[89]|
              9[12]
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>9[01]\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>80\d{6}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- St. Lucia (LC) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000B1/en -->
    <territory id="LC" countryCode="1" leadingDigits="758" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-8]\d{6})$|1"
               nationalPrefixTransformRule="758$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            758|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Adding 430 since numbers have been found with these prefixes online. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7584305678</exampleNumber>
        <nationalNumberPattern>
          758(?:
            234|
            4(?:
              30|
              5\d|
              6[2-9]|
              8[0-2]
            )|
            57[0-2]|
            (?:
              63|
              75
            )8
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7582845678</exampleNumber>
        <nationalNumberPattern>
          758(?:
            28[4-7]|
            384|
            4(?:
              6[01]|
              8[4-9]
            )|
            5(?:
              1[89]|
              20|
              84
            )|
            7(?:
              1[2-9]|
              2\d|
              3[0-3]
            )|
            812
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Liechtenstein (LI) -->
    <!-- The national prefix of "0" is only used for 0800 and 0900 numbers. Three carrier-selection
         codes are in use. -->
    <!-- http://www.llv.li/#/11193 -->
    <!-- https://www.itu.int/oth/T020200007B/en -->
    <territory id="LI" countryCode="423" internationalPrefix="00" nationalPrefix="0"
               nationalPrefixForParsing="(1001)|0">
      <availableFormats>
        <!-- Number format for national mobile services, fixed-line, toll-free, UAN and premium rate services.
             Some different patterns for tollfree and shared cost numbers may be found by searching
             for Mehrwertnummer at http://www.telecom.li. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            [2379]|
            8(?:
              0[09]|
              7
            )
          </leadingDigits>
          <leadingDigits>
            [2379]|
            8(?:
              0(?:
                02|
                9
              )|
              7
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Number format for voicemail services. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>69</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Number format for international mobile services. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [68]\d{8}|
          (?:
            [2378]\d|
            90
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              01|
              1[27]|
              2[02]|
              3\d|
              6[02-578]|
              96
            )|
            3(?:
              [24]0|
              33|
              7[0135-7]|
              8[048]|
              9[0269]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7,9"/>
        <exampleNumber>660234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            6(?:
              (?:
                4[5-9]|
                5[0-469]
              )\d|
              6(?:
                [024-6]\d|
                [17]0|
                3[7-9]
              )
            )\d|
            7(?:
              [37-9]\d|
              42|
              56
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- The prefix 809 seems to be used for AT&T and Verizon access lines from Liechtenstein,
           even though it doesn't appear in the plan. Prefix 8005 of length 9-digit added on user report. -->
      <tollFree>
        <possibleLengths national="7,9"/>
        <exampleNumber>8002222</exampleNumber>
        <nationalNumberPattern>
          8002[28]\d\d|
          80(?:
            05\d|
            9
          )\d{4}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>9002222</exampleNumber>
        <nationalNumberPattern>
          90(?:
            02[258]|
            1(?:
              23|
              3[14]
            )|
            66[136]
          )\d\d
        </nationalNumberPattern>
      </premiumRate>
      <uan>
        <possibleLengths national="7"/>
        <exampleNumber>8702812</exampleNumber>
        <nationalNumberPattern>
          870(?:
            28|
            87
          )\d\d
        </nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="9"/>
        <exampleNumber>697861234</exampleNumber>
        <nationalNumberPattern>
          697(?:
            42|
            56|
            [78]\d
          )\d{4}
        </nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Sri Lanka (LK) -->
    <!-- http://en.wikipedia.org/wiki/%2B94 -->
    <!-- http://www.itu.int/oth/T02020000C3/en -->
    <territory id="LK" countryCode="94" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- Format for mobile numbers. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for fixed-line numbers. The two digit area code and single digit operator
             codes are grouped as it is the most common way of writing fixed-line numbers in LK. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-689]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <!-- The first two digits are area codes followed by single digit operator codes ([2-57]).
           There is evidence that local dialling is supported by removing the area code, but
           not the operator code. This results in the area code length not matching the first
           group of the format (which is very unusual). As there is no evidence for how local
           numbers would be formatted, that has been omitted for now. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>112345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            12[2-9]|
            602|
            8[12]\d|
            9(?:
              1\d|
              22|
              9[245]
            )
          )\d{6}|
          (?:
            11|
            2[13-7]|
            3[1-8]|
            4[157]|
            5[12457]|
            6[35-7]
          )[2-57]\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding the prefix 76 for Dialog, based on information from open-source users. -->
      <!-- Adding Prefix 702 and 703 based on update from Mobitel which has verified these
           prefixes to be correct. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>712345678</exampleNumber>
        <nationalNumberPattern>
          7(?:
            [0-25-8]\d|
            4[0-4]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Prefix 1973 is assigned to SriLankan Airlines in various locations. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>197312345</exampleNumber>
        <nationalNumberPattern>1973\d{5}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Liberia (LR) -->
    <!-- http://www.itu.int/oth/T0202000079/en -->
    <territory id="LR" countryCode="231" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            4[67]|
            [56]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Formatting from Ministry of Agriculture,
             http://www.moa.gov.lr/content.php?sub=Email&?related=Contacts -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-578]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [245]\d|
            33|
            77|
            88
          )\d{7}|
          (?:
            2\d|
            [4-6]
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>2\d{7}</nationalNumberPattern>
      </fixedLine>
      <!-- West Africa Telecom seems to be a mobile company from their website. -->
      <mobile>
        <possibleLengths national="7,9"/>
        <exampleNumber>770123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              (?:
                22|
                33
              )0|
              555|
              (?:
                77|
                88
              )\d
            )\d|
            4(?:
              240|
              [67]
            )
          )\d{5}|
          [56]\d{6}
        </nationalNumberPattern>
      </mobile>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>332021234</exampleNumber>
        <nationalNumberPattern>
          332(?:
            02|
            [34]\d
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Lesotho (LS) -->
    <!-- http://www.itu.int/oth/T0202000078/en -->
    <territory id="LS" countryCode="266" internationalPrefix="00">
      <availableFormats>
        <!-- Formatting following yellow pages: http://www.yellowpages.co.ls -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[2568]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [256]\d\d|
            800
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22123456</exampleNumber>
        <nationalNumberPattern>2\d{7}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>50123456</exampleNumber>
        <nationalNumberPattern>[56]\d{7}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80021234</exampleNumber>
        <nationalNumberPattern>800[1256]\d{4}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Lithuania (LT) -->
    <!-- Note that Lithuania is switching to a national prefix of 0. We support
         both 0 and 8 when parsing until this switch is complete. -->
    <!-- http://www.itu.int/oth/T020200007C/en -->
    <!-- National Prefix formatting rule from http://www.yellowpages.lt -->
    <territory id="LT" countryCode="370" internationalPrefix="00" nationalPrefix="8"
               nationalPrefixForParsing="[08]" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 1 digit area code (fixed line only) -->
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="($NP-$FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>52[0-7]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Non-geographic numbers (toll free, UAN etc.) -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP $FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[7-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 2 digit area codes (fixed line only) -->
        <numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="($NP-$FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            37|
            4(?:
              [15]|
              6[1-8]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 3 digit area codes and other formats (mobile etc.) -->
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="($NP-$FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[3-6]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [3469]\d|
            52|
            [78]0
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>31234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[1478]|
            4[124-6]|
            52
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>61234567</exampleNumber>
        <nationalNumberPattern>6\d{7}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>80[02]\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90012345</exampleNumber>
        <nationalNumberPattern>
          9(?:
            0[0239]|
            10
          )\d{5}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>80812345</exampleNumber>
        <nationalNumberPattern>808\d{5}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>70012345</exampleNumber>
        <nationalNumberPattern>70[05]\d{5}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>[89]01\d{5}</nationalNumberPattern>
      </voip>
      <!-- Including government service numbers here too. -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>70712345</exampleNumber>
        <nationalNumberPattern>70[67]\d{5}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Luxembourg (LU) -->
    <!-- https://web.ilr.lu/FR/Professionnels/Communications-electroniques/Pages/HomePage.aspx -->
    <!-- http://legilux.public.lu/eli/etat/leg/rilr/2014/07/14/n2/jo -->
    <territory id="LU" countryCode="352" internationalPrefix="00"
               nationalPrefixForParsing="(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\d)"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- This format is for 5 digit fixed-line ranges. -->
        <numberFormat pattern="(\d{2})(\d{3})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            2(?:
              0[2-689]|
              [2-9]
            )|
            [3-57]|
            8(?:
              0[2-9]|
              [13-9]
            )|
            9(?:
              0[89]|
              [2-579]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Patterns overlap because of variable number length. This format is for 6 digit
             fixed-line ranges. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            2(?:
              0[2-689]|
              [2-9]
            )|
            [3-57]|
            8(?:
              0[2-9]|
              [13-9]
            )|
            9(?:
              0[89]|
              [2-579]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- This format is for 7 digit fixed-line ranges -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>20[2-689]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- This format is for 7 and 8 digit fixed-line ranges. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{1,2})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            2(?:
              [0367]|
              4[3-8]
            )
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Format for variable cost types like premium-rate, toll-free. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            80[01]|
            90[015]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- This format is for 9 digit fixed-line ranges. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{3})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>20</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Format for mobile numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- This format is for some 9 or 10 digit fixed-line ranges. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})(\d{1,2})"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            2(?:
              [0367]|
              4[3-8]
            )
          </leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
        <!-- This format is for 7 to 11 digit fixed-line ranges. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{1,5})" carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>
            [3-57]|
            8[13-9]|
            9(?:
              0[89]|
              [2-579]
            )|
            (?:
              2|
              80
            )[2-9]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          35[013-9]\d{4,8}|
          6\d{8}|
          35\d{2,4}|
          (?:
            [2457-9]\d|
            3[0-46-9]
          )\d{2,9}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Even though 20 is listed in the fixed-line plan, other documentation clarify that it is
           for VOIP. Furthermore, even though the plan says that numbers beginning with 2[346-8]
           by default are 8 digits, from information found online it seems that they can actually
           be 4 up to 11 digits long. -->
      <fixedLine>
        <possibleLengths national="[4-11]"/>
        <exampleNumber>27123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            35[013-9]|
            80[2-9]|
            90[89]
          )\d{1,8}|
          (?:
            2[2-9]|
            3[0-46-9]|
            [457]\d|
            8[13-9]|
            9[2-579]
          )\d{2,9}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 679 (9 digit) are mentioned as "special mobile services" in ilr.lu's doc. Supporting here
           as per Luxembourg Regulation doc of 14 July 2014 which says all mobile ranges start with
           digit 6. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>628123456</exampleNumber>
        <nationalNumberPattern>
          6(?:
            [269][18]|
            5[1568]|
            7[189]|
            81
          )\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[015]\d{5}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>80112345</exampleNumber>
        <nationalNumberPattern>801\d{5}</nationalNumberPattern>
      </sharedCost>
      <!-- The document says the normal length will be 8 digits, but many numbers found online
           deviate from that. The prefixes from the following document have been added:
           http://www.ilr.public.lu/communications_electroniques/numerotation/plan_nat_num/numeros_geographiques_geo.pdf
           201 has also been added since a diallable number was found online, and it says in
           http://www.ilr.public.lu/communications_electroniques/decisions/2004/0479.pdf that no
           numbers will be issued that begin with 200, numbers beginning with 201 will be issued
           one at a time, and 202-209 in blocks. -->
      <voip>
        <possibleLengths national="[4-10]"/>
        <exampleNumber>20201234</exampleNumber>
        <nationalNumberPattern>
          20(?:
            1\d{5}|
            [2-689]\d{1,7}
          )
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Latvia (LV) -->
    <!-- http://www.itu.int/oth/T0202000076/en -->
    <!-- http://en.wikipedia.org/wiki/+371 -->
    <territory id="LV" countryCode="371" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
          <leadingDigits>
            [269]|
            8[01]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [268]\d|
            90
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>63123456</exampleNumber>
        <nationalNumberPattern>6\d{7}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>
          23(?:
            23[0-57-9]|
            33[0238]
          )\d{3}|
          2(?:
            [0-24-9]\d\d|
            3(?:
              0[07]|
              [14-9]\d|
              2[024-9]|
              3[0-24-9]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>80\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>90\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>81123456</exampleNumber>
        <nationalNumberPattern>81\d{6}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Libya (LY) -->
    <!-- Status as of 21 Jan 2011: a lot of outdated information on the web including on wikipedia
         and itu.int. The new area codes are on the Arabic website of the main telecommunication
         operator (Hatef Libya). A new mobile operator Aljeel Aljadeed for Technology will start
         using 096 (they are allowing customers to register numbers currently), so their code has
         also been added. -->
    <!-- http://hlc.ly/price.php -->
    <territory id="LY" countryCode="218" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>212345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              0[56]|
              [1-6]\d|
              7[124579]|
              8[124]
            )|
            3(?:
              1\d|
              2[2356]
            )|
            4(?:
              [17]\d|
              2[1-357]|
              5[2-4]|
              8[124]
            )|
            5(?:
              [1347]\d|
              2[1-469]|
              5[13-5]|
              8[1-4]
            )|
            6(?:
              [1-479]\d|
              5[2-57]|
              8[1-5]
            )|
            7(?:
              [13]\d|
              2[13-79]
            )|
            8(?:
              [124]\d|
              5[124]|
              84
            )
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- The prefix 094 has been added on the strength of numbers found online, and numbers
           where SMS messages have been apparently successfully received. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>9[1-6]\d{7}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Morocco (MA) -->
    <!-- Main region for 'EH' -->
    <!-- http://www.itu.int/oth/T0202000090/en -->
    <!-- http://en.wikipedia.org/wiki/+212 -->
    <!-- https://www.anrt.ma/content/plan-de-numerotation -->
    <!-- https://www.anrt.ma/en/missions/gestion-des-ressources/numerotation -->
    <territory id="MA" mainCountryForCode="true" countryCode="212" internationalPrefix="00"
               nationalPrefix="0" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- This format is added based on online references found. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>5[45]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            5(?:
              2[2-46-9]|
              3[3-9]|
              9
            )|
            8(?:
              0[89]|
              92
            )
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[5-7]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[5-8]\d{8}</nationalNumberPattern>
      </generalDesc>
      <!-- Prefix 5220 and 5364 was added from a user report. -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>520123456</exampleNumber>
        <nationalNumberPattern>
          5(?:
            2(?:
              [0-25-79]\d|
              3[1-578]|
              4[02-46-8]|
              8[0235-7]
            )|
            3(?:
              [0-47]\d|
              5[02-9]|
              6[02-8]|
              8[014-9]|
              9[3-9]
            )|
            (?:
              4[067]|
              5[03]
            )\d
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Also duplicated in Western Sahara, please ensure you update both. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>650123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            6(?:
              [0-79]\d|
              8[0-247-9]
            )|
            7(?:
              [0167]\d|
              2[0-4]|
              5[01]|
              8[0-3]
            )
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>80[0-7]\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>891234567</exampleNumber>
        <nationalNumberPattern>89\d{7}</nationalNumberPattern>
      </premiumRate>
      <!-- Putting VSAT numbers here. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>592401234</exampleNumber>
        <nationalNumberPattern>
          (?:
            592(?:
              4[0-2]|
              93
            )|
            80[89]\d\d
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Monaco (MC) -->
    <!-- We support Kosovo mobile numbers (044, 045) with a Monaco calling code here, while Kosovo
         numbers all move over to the +383 plan. Kosovo numbers are still under several calling
         codes. It also seems that the national prefix is only used for mobile numbers, not
         fixed-line. -->
    <!-- http://www.itu.int/oth/T020200008D/en -->
    <territory id="MC" countryCode="377" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- National only fixed line numbers -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})">
          <leadingDigits>87</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Alternate format for mobile ranges starting with 4.
             4X mobile numbers are actually used by Kosovo, which might explain the format difference. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>4</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line and some mobile ranges formatting.
             This formatting was found online rather than in the ITU document example.
             For the mobile prefix 3, we could not get authoritative information, so following
             the behaviour of fixed-line numbers beginning with 9 for now. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[389]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- 9-digit mobile numbers. -->
        <numberFormat pattern="(\d)(\d{2})(\d{2})(\d{2})(\d{2})"
                      nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [3489]|
            6\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="8"/>
        <nationalNumberPattern>8[07]0\d{5}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- Restricted to this as no numbers with the prefix of 91, 95 or 96 have been found. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>99123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            870|
            9[2-47-9]\d
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 4X mobile numbers are actually used by Kosovo. -->
      <mobile>
        <possibleLengths national="8,9"/>
        <exampleNumber>612345678</exampleNumber>
        <nationalNumberPattern>
          4(?:
            [46]\d|
            5[1-9]
          )\d{5}|
          (?:
            3|
            6\d
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            800|
            90\d
          )\d{5}
        </nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Moldova (MD) -->
    <!-- As per the ITU doc, 1010 – 1099 are carrier access codes in Moldova, but we are not sure
         of their usage, such as whether they're used for national or international calls. -->
    <!-- Announcements -->
    <!-- Mobile ranges -->
    <!-- http://www.itu.int/oth/T020200008C/en -->
    <!-- http://anrceti.md/fileupload/58 -->
    <!-- http://en.anrceti.md/resurse_numerotare_tel_mobila -->
    <territory id="MD" countryCode="373" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            22|
            3
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[25-7]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [235-7]\d|
            [89]0
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22212345</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              2[1-9]|
              3[1-79]
            )\d|
            5(?:
              33|
              5[257]
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Includes prefixes for Interdnestrcom, http://www.idknet.com/. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>62112345</exampleNumber>
        <nationalNumberPattern>
          562\d{5}|
          (?:
            6\d|
            7[16-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[056]\d{5}</nationalNumberPattern>
      </premiumRate>
      <!-- Information came from en.anrceti.md/node/81 -->
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>80812345</exampleNumber>
        <nationalNumberPattern>808\d{5}</nationalNumberPattern>
      </sharedCost>
      <!-- Used for "nomadic numbers". -->
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>30123456</exampleNumber>
        <nationalNumberPattern>3[08]\d{6}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>80312345</exampleNumber>
        <nationalNumberPattern>803\d{5}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Montenegro (ME) -->
    <!-- According to EKIP, the detailed phone number assignments are published on their
         website (regulation:
         http://www.ekip.me/download/Law%20on%20Electronic%20Communications%20(updated)%204.9.2013%20(1)nova%20verzija.pdf
         ). Thus ITU updates always need to be combined with the information at the below ekip.me source URL. -->
    <!-- http://www.itu.int/oth/T02020000DA/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Montenegro -->
    <!-- http://www.ekip.me/numeracija/dodijeljena.php -->
    <territory id="ME" countryCode="382" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            20|
            [3-79]\d
          )\d{6}|
          80\d{6,7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Fixed line numbers have prefix 20,30,31,32,33,40,41,50,51,52 followed by 6 digits.
           The valid options for the third digit were from
           http://www.ekip.me/numeracija/dodijeljena.php -->
      <fixedLine>
        <possibleLengths national="8" localOnly="6"/>
        <exampleNumber>30234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            20[2-8]|
            3(?:
              [0-2][2-7]|
              3[24-7]
            )|
            4(?:
              0[2-467]|
              1[2467]
            )|
            5(?:
              0[2467]|
              1[24-7]|
              2[2-467]
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- According to ITU it is possible for mobile numbers to be 4-12 digits long
           (http://www.itu.int/oth/T02020000DA/en). However, in reality they seem to be 8 digits
           long. In particular, http://www.ekip.me/numeracija/dodijeljena.php mentions 67[0-2]
           numbers to be 9 digits long but this seems to be no longer the case, based on user
           reports and online examples. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>67622901</exampleNumber>
        <nationalNumberPattern>
          6(?:
            [07-9]\d|
            3[024]|
            6[0-25]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8,9"/>
        <exampleNumber>80080002</exampleNumber>
        <nationalNumberPattern>
          80(?:
            [0-2578]|
            9\d
          )\d{5}
        </nationalNumberPattern>
      </tollFree>
      <!-- Numbers with prefix 94 or 95 are services with additional charges. -->
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>94515151</exampleNumber>
        <nationalNumberPattern>
          9(?:
            4[1568]|
            5[178]
          )\d{5}
        </nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>78108780</exampleNumber>
        <nationalNumberPattern>78[1-49]\d{5}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>77273012</exampleNumber>
        <nationalNumberPattern>77[1-9]\d{5}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- St. Martin (MF) -->
    <!-- Calling code and formatting shared with 'GP' -->
    <!-- Linked from http://www.arcep.fr/index.php?id=interactivenumeros -->
    <!-- http://www.itu.int/oth/T0202000058/en -->
    <!-- http://www.arcep.fr/fileadmin/reprise/dossiers/numero/ZABPQ-ZNE.xls -->
    <!-- https://extranet.arcep.fr/portail/Op%C3%A9rateursCE/Num%C3%A9rotation.aspx -->
    <territory id="MF" countryCode="590" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          590\d{6}|
          (?:
            69|
            80|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>590271234</exampleNumber>
        <nationalNumberPattern>
          590(?:
            0[079]|
            [14]3|
            [27][79]|
            3[03-7]|
            5[0-268]|
            87
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Any ranges assigned from
           http://www.arcep.fr/index.php?id=interactivenumeros have been listed as belonging to
           Guadeloupe, St Martin and St Barthélemy, since we can't reliably distinguish between
           them. As per Wikipedia Guadeloupe Téléphone Mobile operator is no longer functioning.
           However we support these ranges as they are still mentioned in ARCEP numbering plan
           doc. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>690001234</exampleNumber>
        <nationalNumberPattern>
          69(?:
            0\d\d|
            1(?:
              2[2-9]|
              3[0-5]
            )|
            4(?:
              0[89]|
              1[2-6]|
              9\d
            )|
            6(?:
              1[016-9]|
              5[0-4]|
              [67]\d
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as Toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>976012345</exampleNumber>
        <nationalNumberPattern>
          9(?:
            (?:
              39[5-7]|
              76[018]
            )\d|
            475[0-5]
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Madagascar (MG) -->
    <!-- http://www.itu.int/oth/T020200007F/en -->
    <territory id="MG" countryCode="261" internationalPrefix="00" nationalPrefix="0"
               nationalPrefixForParsing="([24-9]\d{6})$|0" nationalPrefixTransformRule="20$1">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[23]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[23]\d{8}</nationalNumberPattern>
      </generalDesc>
      <!-- Added the prefixes 20 44 and 20 47 as they seem popular on the internet - the plan says
           20 4 is for the rest of the province of Antanarivo, but then fails to mention any area
           codes beginning with 4. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>202123456</exampleNumber>
        <nationalNumberPattern>
          2072[29]\d{4}|
          20(?:
            2\d|
            4[47]|
            5[3467]|
            6[279]|
            7[35]|
            8[268]|
            9[245]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- The numbering plan suggests the third digit, Z, should be 24-9, but this is not borne
           out by reality. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>321234567</exampleNumber>
        <nationalNumberPattern>3[2-47-9]\d{7}</nationalNumberPattern>
      </mobile>
      <!-- Putting VSAT numbers here. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>221234567</exampleNumber>
        <nationalNumberPattern>22\d{7}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Marshall Islands (MH) -->
    <!-- http://www.itu.int/oth/T0202000085/en -->
    <territory id="MH" countryCode="692" internationalPrefix="011" nationalPrefix="1">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-6]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          329\d{4}|
          (?:
            [256]\d|
            45
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2471234</exampleNumber>
        <nationalNumberPattern>
          (?:
            247|
            528|
            625
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>2351234</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              23|
              54
            )5|
            329|
            45[35-8]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- VSAT prefixes are here. -->
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>6351234</exampleNumber>
        <nationalNumberPattern>635\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- North Macedonia (MK) -->
    <!-- http://www.itu.int/oth/T02020000CE/en -->
    <!-- https://e-agencija.aek.mk/aek-crm-portal/Pages/Public/PublicFreeSeries/PublicFreeSeries -->
    <territory id="MK" countryCode="389" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Formats follow wikipedia. For fixed-line numbers with single digit area codes. -->
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            2|
            34[47]|
            4(?:
              [37]7|
              5[47]|
              64
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For fixed-line numbers with two digit area codes and mobile numbers -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[347]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For variable cost ranges. Eg: toll-free, premium-rate -->
        <numberFormat pattern="(\d{3})(\d)(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[58]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-578]\d{7}</nationalNumberPattern>
      </generalDesc>
      <!-- For easier maintenance, supporting ranges at 3 digit granularity vs 5 digit granular
           ranges mentioned in AEK's web portal. -->
      <fixedLine>
        <possibleLengths national="8" localOnly="6,7"/>
        <exampleNumber>22012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              2(?:
                62|
                77
              )0|
              3444
            )\d|
            4[56]440
          )\d{3}|
          (?:
            34|
            4[357]
          )700\d{3}|
          (?:
            2(?:
              [0-3]\d|
              5[0-578]|
              6[01]|
              82
            )|
            3(?:
              1[3-68]|
              [23][2-68]|
              4[23568]
            )|
            4(?:
              [23][2-68]|
              4[3-68]|
              5[2568]|
              6[25-8]|
              7[24-68]|
              8[4-68]
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 79300-79375 were the only ranges assigned to one.Vip according to IR.21 docs. We support
           all of 793 to keep the regex simple. As info in AEK's portal is not complete, supporting
           ranges at 4 digit granularity vs 5 digit granular ranges mentioned. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>72345678</exampleNumber>
        <nationalNumberPattern>
          7(?:
            3555|
            (?:
              474|
              9[019]7
            )7
          )\d{3}|
          7(?:
            [0-25-8]\d\d|
            3(?:
              [1-48]\d|
              6[01]|
              7[01578]
            )|
            4(?:
              2\d|
              60|
              7[01578]
            )|
            9(?:
              [2-4]\d|
              5[01]|
              7[015]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>800\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>50012345</exampleNumber>
        <nationalNumberPattern>5\d{7}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>
          8(?:
            0[1-9]|
            [1-9]\d
          )\d{5}
        </nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Mali (ML) -->
    <!-- http://www.itu.int/oth/T0202000083/en -->
    <!-- http://crt-mali.org/pdf/plan_num -->
    <territory id="ML" countryCode="223" internationalPrefix="00">
      <availableFormats>
        <!-- Explicitly block-format some shortcodes where prefixes overlap "normal" numbers.
             This is needed since there's no national prefix to distinguish national numbers. -->
        <numberFormat pattern="(\d{4})">
          <leadingDigits>
            67[057-9]|
            74[045]
          </leadingDigits>
          <leadingDigits>
            67(?:
              0[09]|
              [59]9|
              77|
              8[89]
            )|
            74(?:
              0[02]|
              44|
              55
            )
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[24-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[24-9]\d{7}</nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="8"/>
        <nationalNumberPattern>80\d{6}</nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>20212345</exampleNumber>
        <nationalNumberPattern>
          2(?:
            07[0-8]|
            12[67]
          )\d{4}|
          (?:
            2(?:
              02|
              1[4-689]
            )|
            4(?:
              0[0-4]|
              4[1-39]
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>65012345</exampleNumber>
        <nationalNumberPattern>
          2(?:
            0(?:
              01|
              79
            )|
            17\d
          )\d{4}|
          (?:
            5[01]|
            [679]\d|
            8[2-49]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Online examples have not been found, but this seems to follow the prescriptions in the
           plan. -->
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>80\d{6}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Myanmar (Burma) (MM) -->
    <!-- http://www.itu.int/oth/T0202000092/en -->
    <territory id="MM" countryCode="95" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- 1-digit area codes (short format). -->
        <numberFormat pattern="(\d)(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            16|
            2
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 2-digit area codes (short format). -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [45]|
            6(?:
              0[23]|
              [1-689]|
              7[235-7]
            )|
            7(?:
              [0-4]|
              5[2-7]
            )|
            8[1-6]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 1-digit area codes. -->
        <numberFormat pattern="(\d)(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[12]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 2-digit area codes. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [4-7]|
            8[1-35]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            9(?:
              2[0-4]|
              [35-9]|
              4[137-9]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 1-digit area codes (long format). -->
        <numberFormat pattern="(\d)(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Toll-free, see: http://mpt.com.mm/en/first-toll-free-call-service-myanmar-mpt/ -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Following majority of numbers found online. -->
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>92</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{5})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1\d{5,7}|
          95\d{6}|
          (?:
            [4-7]|
            9[0-46-9]
          )\d{6,8}|
          (?:
            2|
            8\d
          )\d{5,8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="[6-9]" localOnly="5"/>
        <exampleNumber>1234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              (?:
                2\d|
                3[56]|
                [89][0-6]
              )\d|
              4(?:
                2[29]|
                62|
                7[0-2]|
                83
              )|
              6
            )|
            2(?:
              2(?:
                00|
                8[34]
              )|
              4(?:
                0\d|
                [26]2|
                7[0-2]|
                83
              )|
              51\d\d
            )|
            4(?:
              2(?:
                2\d\d|
                48[013]
              )|
              3(?:
                20\d|
                4(?:
                  70|
                  83
                )|
                56
              )|
              420\d|
              5470
            )|
            6(?:
              0(?:
                [23]|
                88\d
              )|
              (?:
                124|
                [56]2\d
              )\d|
              2472|
              3(?:
                20\d|
                470
              )|
              4(?:
                2[04]\d|
                472
              )|
              7(?:
                (?:
                  3\d|
                  8[01459]
                )\d|
                4[67]0
              )
            )
          )\d{4}|
          5(?:
            2(?:
              2\d{5,6}|
              47[02]\d{4}
            )|
            (?:
              3472|
              4(?:
                2(?:
                  1|
                  86
                )|
                470
              )|
              522\d|
              6(?:
                20\d|
                483
              )|
              7(?:
                20\d|
                48[01]
              )|
              8(?:
                20\d|
                47[02]
              )|
              9(?:
                20\d|
                470
              )
            )\d{4}
          )|
          7(?:
            (?:
              0470|
              4(?:
                25\d|
                470
              )|
              5(?:
                202|
                470|
                96\d
              )
            )\d{4}|
            1(?:
              20\d{4,5}|
              4(?:
                70|
                83
              )\d{4}
            )
          )|
          8(?:
            1(?:
              2\d{5,6}|
              4(?:
                10|
                7[01]\d
              )\d{3}
            )|
            2(?:
              2\d{5,6}|
              (?:
                320|
                490\d
              )\d{3}
            )|
            (?:
              3(?:
                2\d\d|
                470
              )|
              4[24-7]|
              5(?:
                (?:
                  2\d|
                  51
                )\d|
                4(?:
                  [1-35-9]\d|
                  4[0-57-9]
                )
              )|
              6[23]
            )\d{4}
          )|
          (?:
            1[2-6]\d|
            4(?:
              2[24-8]|
              3[2-7]|
              [46][2-6]|
              5[3-5]
            )|
            5(?:
              [27][2-8]|
              3[2-68]|
              4[24-8]|
              5[23]|
              6[2-4]|
              8[24-7]|
              9[2-7]
            )|
            6(?:
              [19]20|
              42[03-6]|
              (?:
                52|
                7[45]
              )\d
            )|
            7(?:
              [04][24-8]|
              [15][2-7]|
              22|
              3[2-4]
            )|
            8(?:
              1[2-689]|
              2[2-8]|
              [35]2\d
            )
          )\d{4}|
          25\d{5,6}|
          (?:
            2[2-9]|
            6(?:
              1[2356]|
              [24][2-6]|
              3[24-6]|
              5[2-4]|
              6[2-8]|
              7[235-7]|
              8[245]|
              9[24]
            )|
            8(?:
              3[24]|
              5[245]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added 99[089] (8 digits), 961 (9 digits), 996 and 997 (10 digits) from bug
           reports/numbers found online. -->
      <mobile>
        <possibleLengths national="[7-10]"/>
        <exampleNumber>92123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            17[01]|
            9(?:
              2(?:
                [0-4]|
                [56]\d\d
              )|
              (?:
                3(?:
                  [0-36]|
                  4\d
                )|
                (?:
                  6\d|
                  8[89]|
                  9[4-8]
                )\d|
                7(?:
                  3|
                  40|
                  [5-9]\d
                )
              )\d|
              4(?:
                (?:
                  [0245]\d|
                  [1379]
                )\d|
                88
              )|
              5[0-6]
            )\d
          )\d{4}|
          9[69]1\d{6}|
          9(?:
            [68]\d|
            9[089]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8008001234</exampleNumber>
        <nationalNumberPattern>
          80080(?:
            0[1-9]|
            2\d
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>13331234</exampleNumber>
        <nationalNumberPattern>
          1333\d{4}|
          [12]468\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Mongolia (MN) -->
    <!-- http://www.itu.int/oth/T020200008E/en -->
    <!-- http://www.crc.gov.mn/k/4L/36 -->
    <territory id="MN" countryCode="976" internationalPrefix="001" nationalPrefix="0">
      <availableFormats>
        <!-- For fixed-line single digit area code numbers. We have only "1" as single digit
             area code until now. Grouping access code and area code, this is why first two
             digits are grouped. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[12]1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for 5X wireless local loop numbers (that are supported in fixed-line)
             which do not need national prefix as per online results. -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[5-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- For fixed-line two digit area code numbers. -->
        <numberFormat pattern="(\d{3})(\d{5,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[12]2[1-3]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- For fixed-line three digit area code numbers. -->
        <numberFormat pattern="(\d{4})(\d{5,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [12](?:
              27|
              3[2-8]|
              4[2-68]|
              5[1-4689]
            )
          </leadingDigits>
          <leadingDigits>
            [12](?:
              27|
              3[2-8]|
              4[2-68]|
              5[1-4689]
            )[0-3]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- For fixed-line four digit area code numbers. -->
        <numberFormat pattern="(\d{5})(\d{4,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[12]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [12]\d{7,9}|
          [5-9]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Note the leading digit is the access code: 1 is used by Mongolia Telecom subscribers
           and 2 is used by Mongolian Railway subscribers. The area code then follows the access
           code, and could be 1 to 4 digits long. We also cover wireless local loop numbers here
           as well, even though we are not certain whether they are in fact fixed or mobile in
           this country. 5-digit subscriber numbers for 4-digit area codes have been added due to
           online numbers being found. -->
      <fixedLine>
        <possibleLengths national="[8-10]" localOnly="[4-6]"/>
        <exampleNumber>53123456</exampleNumber>
        <nationalNumberPattern>
          [12]2[1-3]\d{5,6}|
          (?:
            (?:
              [12](?:
                1|
                27
              )|
              5[368]
            )\d\d|
            7(?:
              0(?:
                [0-5]\d|
                7[078]|
                80
              )|
              128
            )
          )\d{4}|
          [12](?:
            3[2-8]|
            4[2-68]|
            5[1-4689]
          )\d{6,7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>88123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            83[01]|
            92[039]
          )\d{5}|
          (?:
            5[05]|
            6[069]|
            8[015689]|
            9[013-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- No tollFree or premiumRate information can be found. -->
      <!-- According to the document this could be stricter, but there are counter examples
           online. -->
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>75123456</exampleNumber>
        <nationalNumberPattern>
          712[0-79]\d{4}|
          7(?:
            1[013-9]|
            [25-9]\d
          )\d{5}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Macao (MO) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T020200007E/en -->
    <!-- http://www.dsrt.gov.mo/web/en/generalinfo/allocatednum -->
    <territory id="MO" countryCode="853" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{3})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[268]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          0800\d{3}|
          (?:
            28|
            [68]\d
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Added support to specific 811 sub range(3 digit granularity) based on info in
           telecommunications.ctt.gov.mo. Other ranges are from ITU doc. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>28212345</exampleNumber>
        <nationalNumberPattern>
          (?:
            28[2-9]|
            8(?:
              11|
              [2-57-9]\d
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>66123456</exampleNumber>
        <nationalNumberPattern>
          6800[0-79]\d{3}|
          6(?:
            [235]\d\d|
            6(?:
              0[0-5]|
              [1-9]\d
            )|
            8(?:
              0[1-9]|
              [14-8]\d|
              2[5-9]|
              [39][0-4]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>0800501</exampleNumber>
        <nationalNumberPattern>0800\d{3}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Northern Mariana Islands (MP) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000EE/en -->
    <!-- http://www.cnmiphonebook.com/ -->
    <territory id="MP" countryCode="1" leadingDigits="670" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
               nationalPrefixTransformRule="670$1">
      <generalDesc>
        <nationalNumberPattern>
          [58]\d{9}|
          (?:
            67|
            90
          )0\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Extra exchange codes 232, 289, 355, 472, 633, 637, 646, 647, 649, 653, 687, 734 and 828
           were seen in the white and yellow pages, but no numbers with these exchange codes have
           proved to be diallable so we exclude them for now. 783 prefix is supported based on
           user report. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6702345678</exampleNumber>
        <nationalNumberPattern>
          670(?:
            2(?:
              3[3-7]|
              56|
              8[4-8]
            )|
            32[1-38]|
            4(?:
              33|
              8[348]
            )|
            5(?:
              32|
              55|
              88
            )|
            6(?:
              64|
              70|
              82
            )|
            78[3589]|
            8[3-9]8|
            989
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6702345678</exampleNumber>
        <nationalNumberPattern>
          670(?:
            2(?:
              3[3-7]|
              56|
              8[4-8]
            )|
            32[1-38]|
            4(?:
              33|
              8[348]
            )|
            5(?:
              32|
              55|
              88
            )|
            6(?:
              64|
              70|
              82
            )|
            78[3589]|
            8[3-9]8|
            989
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Martinique (MQ) -->
    <!-- The 876 prefix is mentioned in the plan, but the plan is from 2006 and in France VOIP
         numbers were changed from 087 to the 09 prefix in 2009. It is likely this occurred here
         too. -->
    <!-- http://www.itu.int/oth/T0202000086/en -->
    <!-- http://www.arcep.fr/index.php?id=2137&bloc=0596&CMD=RESULTS_NUMEROTATION -->
    <territory id="MQ" countryCode="596" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[569]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          596\d{6}|
          (?:
            69|
            80|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>596301234</exampleNumber>
        <nationalNumberPattern>
          596(?:
            [03-7]\d|
            1[05]|
            2[7-9]|
            8[0-39]|
            9[04-9]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Ranges are updated based on below official page. Search using prefix 0696X. Ex: 06965
           http://www.arcep.fr/index.php?id=2137&amp;bloc=0596&amp;CMD=RESULTS_NUMEROTATION -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>696201234</exampleNumber>
        <nationalNumberPattern>
          69(?:
            6(?:
              [0-46-9]\d|
              5[0-6]
            )|
            727
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as Toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>976612345</exampleNumber>
        <nationalNumberPattern>
          9(?:
            397[0-3]|
            477[0-5]|
            76(?:
              6\d|
              7[0-367]
            )
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Mauritania (MR) -->
    <!-- http://www.itu.int/oth/T0202000087/en -->
    <!-- http://are.mr/pdfs/pnn2010.pdf -->
    <territory id="MR" countryCode="222" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[2-48]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-4]\d\d|
            800
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>35123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            25[08]|
            35\d|
            45[1-7]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added "49\d" in response to https://github.com/google/libphonenumber/issues/529
           which might be overly permissive, but we don't have an official documentation for this
           and only a small number of numbers were found online. At least 492 and 495 are valid. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>22123456</exampleNumber>
        <nationalNumberPattern>[2-4][0-46-9]\d{6}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>800\d{5}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Montserrat (MS) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T020200008F/en -->
    <territory id="MS" countryCode="1" leadingDigits="664" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([34]\d{6})$|1"
               nationalPrefixTransformRule="664$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            664|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6644912345</exampleNumber>
        <nationalNumberPattern>
          6644(?:
            1[0-3]|
            91
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6644923456</exampleNumber>
        <nationalNumberPattern>
          664(?:
            3(?:
              49|
              9[1-6]
            )|
            49[2-6]
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Malta (MT) -->
    <!-- Numbering link in the LHS menu - has more up-to-date allocations -->
    <!-- http://www.itu.int/oth/T0202000084/en -->
    <!-- http://www.mca.org.mt/regulatory/numbering/numbering-plans -->
    <territory id="MT" countryCode="356" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[2357-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          3550\d{4}|
          (?:
            [2579]\d\d|
            800
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21001234</exampleNumber>
        <nationalNumberPattern>
          20(?:
            3[1-4]|
            6[059]
          )\d{4}|
          2(?:
            0[19]|
            [1-357]\d|
            60
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>96961234</exampleNumber>
        <nationalNumberPattern>
          (?:
            7(?:
              210|
              [79]\d\d
            )|
            9(?:
              [29]\d\d|
              69[67]|
              8(?:
                1[1-3]|
                89|
                97
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="8"/>
        <exampleNumber>71171234</exampleNumber>
        <nationalNumberPattern>7117\d{4}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80071234</exampleNumber>
        <nationalNumberPattern>
          800(?:
            02|
            [3467]\d
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>50037123</exampleNumber>
        <nationalNumberPattern>
          5(?:
            0(?:
              0(?:
                37|
                43
              )|
              (?:
                6\d|
                70|
                9[0168]
              )\d
            )|
            [12]\d0[1-5]
          )\d{3}
        </nationalNumberPattern>
      </premiumRate>
      <!-- In the plan as Non-PATS ECS. -->
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>35501234</exampleNumber>
        <nationalNumberPattern>3550\d{4}</nationalNumberPattern>
      </voip>
      <!-- Using this for governmental numbers. -->
      <uan>
        <possibleLengths national="8"/>
        <exampleNumber>50112345</exampleNumber>
        <nationalNumberPattern>501\d{5}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Mauritius (MU) -->
    <!-- Preferred international prefix is expected to standardize on just '00' -->
    <!-- http://www.icta.mu/telecommunications/numbering.htm -->
    <territory id="MU" countryCode="230" preferredInternationalPrefix="020"
               internationalPrefix="0(?:0|[24-7]0|3[03])">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            [2-46]|
            8[013]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[57]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{5})(\d{5})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [57]|
            8\d\d
          )\d{7}|
          [2-468]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- See also: http://www.wtng.info/wtng-230-mu.html for additional detail. Prefix 267 is
           added based on user report. -->
      <fixedLine>
        <possibleLengths national="7,8"/>
        <exampleNumber>54480123</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              [0346-8]\d|
              1[0-7]
            )|
            4(?:
              [013568]\d|
              2[4-8]
            )|
            54(?:
              [3-5]\d|
              71
            )|
            6\d\d|
            8(?:
              14|
              3[129]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>52512345</exampleNumber>
        <nationalNumberPattern>
          5(?:
            4(?:
              2[1-389]|
              7[1-9]
            )|
            87[15-8]
          )\d{4}|
          (?:
            5(?:
              2[5-9]|
              4[3-689]|
              [57]\d|
              8[0-689]|
              9[0-8]
            )|
            7(?:
              0[0-3]|
              3[013]
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- Prefix 802 is added based on user report. -->
      <tollFree>
        <possibleLengths national="7,10"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>
          802\d{7}|
          80[0-2]\d{4}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>3012345</exampleNumber>
        <nationalNumberPattern>30\d{5}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>3201234</exampleNumber>
        <nationalNumberPattern>
          3(?:
            20|
            9\d
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Maldives (MV) -->
    <!-- http://www.itu.int/oth/T0202000082/en -->
    <!-- http://www.dhiraagu.com.mv -->
    <territory id="MV" countryCode="960" preferredInternationalPrefix="00"
               internationalPrefix="0(?:0|19)">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[34679]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- It's not clear whether 800 and 900 numbers have a leading zero; 900 numbers have been
             described in ITU docs without a leading zero, and Maldives doesn't have a trunk
             prefix. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            800|
            9[0-57-9]\d
          )\d{7}|
          [34679]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Prefix 690 is mentioned in old ITU doc dated 2011 however it is not mentioned in
           http://www.cam.gov.mv/ which has newer update 2017. Also no online numbers found, so
           not supporting it. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>6701234</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              0[0-3]|
              3[0-59]
            )|
            6(?:
              [58][024689]|
              6[024-68]|
              7[02468]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 46[46] are new prefixes for Dhiraagu and Ooredoo, used currently for SMS-based
           services. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>7712345</exampleNumber>
        <nationalNumberPattern>
          (?:
            46[46]|
            [79]\d\d
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
      </premiumRate>
      <!-- 400 and 450 numbers are mentioned in the ITU document as "Non Geographic Fixed Service"
           and seem to be used by businesses. -->
      <uan>
        <possibleLengths national="7"/>
        <exampleNumber>4001234</exampleNumber>
        <nationalNumberPattern>
          4(?:
            0[01]|
            50
          )\d{4}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Malawi (MW) -->
    <!-- The plan doesn't state that a national prefix exists, but numbers found on the internet are
         consistent in having one. -->
    <!-- http://www.itu.int/oth/T0202000080/en -->
    <territory id="MW" countryCode="265" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1[2-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[137-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [1289]\d|
            31|
            77
          )\d{7}|
          1\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 14 is no longer mentioned in the plan as a prefix, but plenty of online numbers have
           been found so this is being retained for now. It is possible however that these may be
           old-format mobile numbers. -->
      <fixedLine>
        <possibleLengths national="7,9"/>
        <exampleNumber>1234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[2-9]|
            2[12]\d\d
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>991234567</exampleNumber>
        <nationalNumberPattern>
          111\d{6}|
          (?:
            31|
            77|
            [89][89]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Mexico (MX) -->
    <!-- http://www.itu.int/oth/T020200008A/en -->
    <!-- http://en.wikipedia.org/wiki/%2B52 -->
    <!-- http://en.wikipedia.org/wiki/Premium-rate_telephone_number#Mexico -->
    <!-- http://en.wikipedia.org/wiki/Toll-free_telephone_number -->
    <!-- When a number starts with 01 or 02, we remove the prefixes; when a number starts with 044
         or 045 followed by 10 digits, we replace the prefixes with 1. This way all the mobile
         numbers, regardless of whether they are written in international format (leading 1) or
         national format (leading 044/045), will be parsed into the same form. -->
    <territory id="MX" countryCode="52" preferredInternationalPrefix="00"
               internationalPrefix="0[09]" nationalPrefix="01"
               nationalPrefixForParsing="0(?:[12]|4[45])|1" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 5-digit shortcodes (very rare). -->
        <numberFormat pattern="(\d{5})">
          <leadingDigits>53</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Fixed line (2-digit area codes). -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            33|
            5[56]|
            81
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line (3-digit area codes) and other non-mobile numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile version of fixed line 2-digit area codes and removing former mobile token 1. -->
        <numberFormat pattern="(\d)(\d{2})(\d{4})(\d{4})"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            1(?:
              33|
              5[56]|
              81
            )
          </leadingDigits>
          <format>$2 $3 $4</format>
        </numberFormat>
        <!-- Mobile version of fixed line 3-digit area codes and removing former mobile token 1. -->
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{4})"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>1</leadingDigits>
          <format>$2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1(?:
            (?:
              22|
              44|
              7[27]|
              87|
              99
            )[1-9]|
            65[0-689]
          )\d{7}|
          (?:
            1(?:
              [01]\d|
              2[13-9]|
              [35][1-9]|
              4[0-35-9]|
              6[0-46-9]|
              7[013-689]|
              8[1-69]|
              9[1-8]
            )|
            [2-9]\d
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- http://en.wikipedia.org/wiki/Area_codes_in_Mexico_by_code -->
      <!-- Also covering fixed satellite service numbers (prefixes: 200 and 201). -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7,8"/>
        <exampleNumber>2001234567</exampleNumber>
        <nationalNumberPattern>
          657[12]\d{6}|
          (?:
            2(?:
              0[01]|
              2\d|
              3[1-35-8]|
              4[13-9]|
              7[1-689]|
              8[1-578]|
              9[467]
            )|
            3(?:
              1[1-79]|
              [2458][1-9]|
              3\d|
              7[1-8]|
              9[1-5]
            )|
            4(?:
              1[1-57-9]|
              [25-7][1-9]|
              3[1-8]|
              4\d|
              8[1-35-9]|
              9[2-689]
            )|
            5(?:
              [56]\d|
              88|
              9[1-79]
            )|
            6(?:
              1[2-68]|
              [2-4][1-9]|
              5[1-3689]|
              6[1-57-9]|
              7[1-7]|
              8[67]|
              9[4-8]
            )|
            7(?:
              [1346][1-9]|
              [27]\d|
              5[13-9]|
              8[1-69]|
              9[17]
            )|
            8(?:
              1\d|
              2[13-689]|
              3[1-6]|
              4[124-6]|
              6[1246-9]|
              7[0-378]|
              9[12479]
            )|
            9(?:
              1[346-9]|
              2[1-4]|
              3[2-46-8]|
              5[1348]|
              6[1-9]|
              7[12]|
              8[1-8]|
              9\d
            )
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Fixed satellite service numbers are not included here, although many other prefixes from
           the fixedLine pattern are. -->
      <mobile>
        <possibleLengths national="10,11" localOnly="7,8"/>
        <exampleNumber>12221234567</exampleNumber>
        <nationalNumberPattern>
          657[12]\d{6}|
          (?:
            1(?:
              2(?:
                2[1-9]|
                3[1-35-8]|
                4[13-9]|
                7[1-689]|
                8[1-578]|
                9[467]
              )|
              3(?:
                1[1-79]|
                [2458][1-9]|
                3\d|
                7[1-8]|
                9[1-5]
              )|
              4(?:
                1[1-57-9]|
                [24-7][1-9]|
                3[1-8]|
                8[1-35-9]|
                9[2-689]
              )|
              5(?:
                [56]\d|
                88|
                9[1-79]
              )|
              6(?:
                1[2-68]|
                [2-4][1-9]|
                5[1-3689]|
                6[1-57-9]|
                7[1-7]|
                8[67]|
                9[4-8]
              )|
              7(?:
                [1-467][1-9]|
                5[13-9]|
                8[1-69]|
                9[17]
              )|
              8(?:
                1\d|
                2[13-689]|
                3[1-6]|
                4[124-6]|
                6[1246-9]|
                7[1-378]|
                9[12479]
              )|
              9(?:
                1[346-9]|
                2[1-4]|
                3[2-46-8]|
                5[1348]|
                [69][1-9]|
                7[12]|
                8[1-8]
              )
            )|
            2(?:
              2\d|
              3[1-35-8]|
              4[13-9]|
              7[1-689]|
              8[1-578]|
              9[467]
            )|
            3(?:
              1[1-79]|
              [2458][1-9]|
              3\d|
              7[1-8]|
              9[1-5]
            )|
            4(?:
              1[1-57-9]|
              [25-7][1-9]|
              3[1-8]|
              4\d|
              8[1-35-9]|
              9[2-689]
            )|
            5(?:
              [56]\d|
              88|
              9[1-79]
            )|
            6(?:
              1[2-68]|
              [2-4][1-9]|
              5[1-3689]|
              6[1-57-9]|
              7[1-7]|
              8[67]|
              9[4-8]
            )|
            7(?:
              [1346][1-9]|
              [27]\d|
              5[13-9]|
              8[1-69]|
              9[17]
            )|
            8(?:
              1\d|
              2[13-689]|
              3[1-6]|
              4[124-6]|
              6[1246-9]|
              7[0-378]|
              9[12479]
            )|
            9(?:
              1[346-9]|
              2[1-4]|
              3[2-46-8]|
              5[1348]|
              6[1-9]|
              7[12]|
              8[1-8]|
              9\d
            )
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            88
          )\d{7}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="10"/>
        <exampleNumber>3001234567</exampleNumber>
        <nationalNumberPattern>300\d{7}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5001234567</exampleNumber>
        <nationalNumberPattern>500\d{7}</nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Malaysia (MY) -->
    <!-- http://en.wikipedia.org/wiki/%2B60 -->
    <!-- https://www.mcmc.gov.my/sectors/celco/numbering-management/numbering-management/numbers-assignment -->
    <territory id="MY" countryCode="60" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 8-digit fixed line ranges -->
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[4-79]</leadingDigits>
          <format>$1-$2 $3</format>
        </numberFormat>
        <!-- 8/9-digit fixed line or mobile ranges -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1(?:
              [02469]|
              [378][1-9]|
              53
            )|
            8
          </leadingDigits>
          <leadingDigits>
            1(?:
              [02469]|
              [37][1-9]|
              53|
              8(?:
                [1-46-9]|
                5[7-9]
              )
            )|
            8
          </leadingDigits>
          <format>$1-$2 $3</format>
        </numberFormat>
        <!-- 9-digit fixed line ranges -->
        <numberFormat pattern="(\d)(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>3</leadingDigits>
          <format>$1-$2 $3</format>
        </numberFormat>
        <!-- Variable cost (premium rate, toll free etc.) -->
        <numberFormat pattern="(\d)(\d{3})(\d{2})(\d{4})">
          <leadingDigits>
            1(?:
              [367]|
              80
            )
          </leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
        <!-- 10 digit mobile or voip ranges -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>15</leadingDigits>
          <format>$1-$2 $3</format>
        </numberFormat>
        <!-- 10 digit mobile ranges -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1-$2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1\d{8,9}|
          (?:
            3\d|
            [4-9]
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Prefixes 32778, 39108, 6795, 82266, 905[79], 9075, 9132 and 9206 are added based on user
           reports. Maintaining prefix data at 3 digit granularity as the new fixed-line ranges are
           being added frequently in mcmc.gov.my docs. This avoids false negatives and eases up the
           maintenance. -->
      <fixedLine>
        <possibleLengths national="8,9" localOnly="6,7"/>
        <exampleNumber>323856789</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              2[0-36-9]|
              3[0-368]|
              4[0-278]|
              5[0-24-8]|
              6[0-467]|
              7[1246-9]|
              8\d|
              9[0-57]
            )\d|
            4(?:
              2[0-689]|
              [3-79]\d|
              8[1-35689]
            )|
            5(?:
              2[0-589]|
              [3468]\d|
              5[0-489]|
              7[1-9]|
              9[23]
            )|
            6(?:
              2[2-9]|
              3[1357-9]|
              [46]\d|
              5[0-6]|
              7[0-35-9]|
              85|
              9[015-8]
            )|
            7(?:
              [2579]\d|
              3[03-68]|
              4[0-8]|
              6[5-9]|
              8[0-35-9]
            )|
            8(?:
              [24][2-8]|
              3[2-5]|
              5[2-7]|
              6[2-589]|
              7[2-578]|
              [89][2-9]
            )|
            9(?:
              0[57]|
              13|
              [25-7]\d|
              [3489][0-8]
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Although the plan lists the prefix 159 as broadband services (data only), apparently it
           is possible to send SMSs (and receive them) from numbers in this block, so we are
           listing them as mobile. 11[4-6] was added based on numbers found online. -->
      <mobile>
        <possibleLengths national="9,10"/>
        <exampleNumber>123456789</exampleNumber>
        <nationalNumberPattern>
          1(?:
            1888[689]|
            4400|
            8(?:
              47|
              8[27]
            )[0-4]
          )\d{4}|
          1(?:
            0(?:
              [23568]\d|
              4[0-6]|
              7[016-9]|
              9[0-8]
            )|
            1(?:
              [1-5]\d\d|
              6(?:
                0[5-9]|
                [1-9]\d
              )|
              7(?:
                [0-4]\d|
                5[0-7]
              )
            )|
            (?:
              [269]\d|
              [37][1-9]|
              4[235-9]
            )\d|
            5(?:
              31|
              9\d\d
            )|
            8(?:
              1[23]|
              [236]\d|
              4[06]|
              5(?:
                46|
                [7-9]
              )|
              7[016-9]|
              8[01]|
              9[0-8]
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- http://www.skmm.gov.my/skmmgovmy/media/General/pdf/Special_Service_Number.pdf -->
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>1300123456</exampleNumber>
        <nationalNumberPattern>1[378]00\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>1600123456</exampleNumber>
        <nationalNumberPattern>1600\d{6}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>1546012345</exampleNumber>
        <nationalNumberPattern>
          15(?:
            4(?:
              6[0-4]\d|
              8(?:
                0[125]|
                [17]\d|
                21|
                3[01]|
                4[01589]|
                5[014]|
                6[02]
              )
            )|
            6(?:
              32[0-6]|
              78\d
            )
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Mozambique (MZ) -->
    <!-- The plan suggests 801 and 802 numbers are shared-cost numbers, and numbers beginning with
         a 9 are premium rate, but no online examples can be found of any of these so they are
         omitted for the time-being. -->
    <!-- http://www.itu.int/oth/T0202000091/en -->
    <territory id="MZ" countryCode="258" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})">
          <leadingDigits>
            2|
            8[2-79]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            2|
            8\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21123456</exampleNumber>
        <nationalNumberPattern>
          2(?:
            [1346]\d|
            5[0-2]|
            [78][12]|
            93
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>821234567</exampleNumber>
        <nationalNumberPattern>8[2-79]\d{7}</nationalNumberPattern>
      </mobile>
      <!-- Unsure of the length requirement on toll-free numbers, so using 9 based on online
           examples. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Namibia (NA) -->
    <!-- http://www.itu.int/oth/T0202000093/en -->
    <territory id="NA" countryCode="264" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>88</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>87</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[68]\d{7,8}</nationalNumberPattern>
      </generalDesc>
      <!-- Includes VSAT service. Added 6768 and 64426 prefix based on user
           report. -->
      <fixedLine>
        <possibleLengths national="8,9"/>
        <exampleNumber>61221234</exampleNumber>
        <nationalNumberPattern>
          64426\d{3}|
          6(?:
            1(?:
              2[2-7]|
              3[01378]|
              4[0-4]
            )|
            254|
            32[0237]|
            4(?:
              27|
              41|
              5[25]
            )|
            52[236-8]|
            626|
            7(?:
              2[2-4]|
              30
            )
          )\d{4,5}|
          6(?:
            1(?:
              (?:
                0\d|
                2[0189]|
                3[24-69]|
                4[5-9]
              )\d|
              17|
              69|
              7[014]
            )|
            2(?:
              17|
              5[0-36-8]|
              69|
              70
            )|
            3(?:
              17|
              2[14-689]|
              34|
              6[289]|
              7[01]|
              81
            )|
            4(?:
              17|
              2[0-2]|
              4[06]|
              5[0137]|
              69|
              7[01]
            )|
            5(?:
              17|
              2[0459]|
              69|
              7[01]
            )|
            6(?:
              17|
              25|
              38|
              42|
              69|
              7[01]
            )|
            7(?:
              17|
              2[569]|
              3[13]|
              6[89]|
              7[01]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Includes the Switch CDMA Service. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>811234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            60|
            8[1245]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>870123456</exampleNumber>
        <nationalNumberPattern>8701\d{5}</nationalNumberPattern>
      </premiumRate>
      <!-- Including virtual telephone and VOIP services. -->
      <voip>
        <possibleLengths national="8,9"/>
        <exampleNumber>88612345</exampleNumber>
        <nationalNumberPattern>
          8(?:
            3\d\d|
            86
          )\d{5}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- New Caledonia (NC) -->
    <!-- http://www.itu.int/oth/T0202000098/en -->
    <!-- http://www.opt.nc -->
    <territory id="NC" countryCode="687" internationalPrefix="00">
      <availableFormats>
        <!-- 3-digit Shortcodes which would otherwise be formatted as 'XX.X' -->
        <numberFormat pattern="(\d{3})">
          <leadingDigits>5[6-8]</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- From http://www.1012.nc, the local yellow pages. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[02-57-9]</leadingDigits>
          <format>$1.$2.$3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            050|
            [2-57-9]\d\d
          )\d{3}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Including the 88 prefix for public payphones. -->
      <fixedLine>
        <possibleLengths national="6"/>
        <exampleNumber>201234</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[03-9]|
            3[0-5]|
            4[1-7]|
            88
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="6"/>
        <exampleNumber>751234</exampleNumber>
        <nationalNumberPattern>
          (?:
            5[0-4]|
            [79]\d|
            8[0-79]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- Prefix 050 is added based on user report.
           https://www.enercal.nc/nos-agences/ (click on DUMBEA CENTRE in the list) -->
      <tollFree>
        <possibleLengths national="6"/>
        <exampleNumber>050012</exampleNumber>
        <nationalNumberPattern>050\d{3}</nationalNumberPattern>
      </tollFree>
      <!-- Listed as "voice services", from what we've seen they seem to cost extra. -->
      <!-- Note that OPT lists 3631 as a free short number for caller ID services, but the ITU
           document says that all 36 numbers are 6 digits. See ShortNumberMetadata.xml for more. -->
      <premiumRate>
        <possibleLengths national="6"/>
        <exampleNumber>366711</exampleNumber>
        <nationalNumberPattern>36\d{4}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Niger (NE) -->
    <!-- http://www.itu.int/oth/T020200009B/en -->
    <territory id="NE" countryCode="227" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
          <leadingDigits>08</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            [089]|
            2[013]|
            7[047]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[027-9]\d{7}</nationalNumberPattern>
      </generalDesc>
      <!-- Adding 20 61 from online numbers. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>20201234</exampleNumber>
        <nationalNumberPattern>
          2(?:
            0(?:
              20|
              3[1-8]|
              4[13-5]|
              5[14]|
              6[14578]|
              7[1-578]
            )|
            1(?:
              4[145]|
              5[14]|
              6[14-68]|
              7[169]|
              88
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added 84, 85, 88, 90, 91, 92, 98 and 99 from online data. Airtel have confirmed that
           they use the 89 and 97 prefixes, and Orange use 92. MOOV started using 95 in Jan
           2014. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>93123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            23|
            7[047]|
            [89]\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>08123456</exampleNumber>
        <nationalNumberPattern>08\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>09123456</exampleNumber>
        <nationalNumberPattern>09\d{6}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Norfolk Island (NF) -->
    <!-- Including numbers for Australian Antarctic stations. -->
    <!-- http://www.itu.int/oth/T020200009D/en -->
    <territory id="NF" countryCode="672" internationalPrefix="00"
               nationalPrefixForParsing="([0-258]\d{4})$" nationalPrefixTransformRule="3$1">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})">
          <leadingDigits>1[0-3]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{5})">
          <leadingDigits>[13]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[13]\d{5}</nationalNumberPattern>
      </generalDesc>
      <!-- ITU says all 3X numbers except 38 are fixed-line, but 3[34679] numbers don't seem to
           connect after we tried calling them. -->
      <fixedLine>
        <possibleLengths national="6" localOnly="5"/>
        <exampleNumber>106609</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              06|
              17|
              28|
              39
            )|
            3[0-2]\d
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Numbers found online with prefix 35. -->
      <mobile>
        <possibleLengths national="6" localOnly="5"/>
        <exampleNumber>381234</exampleNumber>
        <nationalNumberPattern>
          (?:
            14|
            3[58]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Nigeria (NG) -->
    <!-- http://www.itu.int/oth/T020200009C/en -->
    <!-- https://www.ncc.gov.ng/technology/standards/numbering -->
    <territory id="NG" countryCode="234" internationalPrefix="009" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Special case for (rare) 7-digit fixed line numbers. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>78</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line format for 1 digit area code -->
        <numberFormat pattern="(\d)(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [12]|
            9(?:
              0[3-9]|
              [1-9]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line format for 2 digit area code -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [3-6]|
            7(?:
              0[0-689]|
              [1-79]
            )|
            8[2-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[7-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>20[129]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 11-12 digit toll-free and UAN numbers. -->
        <numberFormat pattern="(\d{3})(\d{4})(\d{4,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[78]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 13-14 digit toll-free and UAN numbers. -->
        <numberFormat pattern="(\d{3})(\d{5})(\d{5,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[78]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          2[0-24-9]\d{8}|
          [78]\d{10,13}|
          [7-9]\d{9}|
          [1-9]\d{7}|
          [124-7]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7,8,10" localOnly="5,6"/>
        <exampleNumber>18040123</exampleNumber>
        <nationalNumberPattern>
          20(?:
            [1259]\d|
            3[013-9]|
            4[1-8]|
            6[024-689]|
            7[1-79]|
            8[2-9]
          )\d{6}|
          (?:
            (?:
              [1-356]\d|
              4[02-8]|
              8[2-9]
            )\d|
            9(?:
              0[3-9]|
              [1-9]\d
            )
          )\d{5}|
          7(?:
            0(?:
              [013-689]\d|
              2[0-24-9]
            )\d{3,4}|
            [1-79]\d{6}
          )|
          (?:
            [12]\d|
            4[147]|
            5[14579]|
            6[1578]|
            7[1-3578]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added 906 and 907 mobile prefixes based on reports. Prefix 707 is withdrawn as per few
           websites, however 707[0-3] is added based on bug report and online search. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>8021234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            702[0-24-9]|
            819[01]
          )\d{6}|
          (?:
            7(?:
              0[13-9]|
              [12]\d
            )|
            8(?:
              0[1-9]|
              1[0-8]
            )|
            9(?:
              0[1-9]|
              1[1-6]
            )
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- Info on these numbers from http://www.alphatechnologieslimited.com. -->
      <tollFree>
        <possibleLengths national="[10-14]"/>
        <exampleNumber>80017591759</exampleNumber>
        <nationalNumberPattern>800\d{7,11}</nationalNumberPattern>
      </tollFree>
      <uan>
        <possibleLengths national="[10-14]"/>
        <exampleNumber>7001234567</exampleNumber>
        <nationalNumberPattern>700\d{7,11}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Nicaragua (NI) -->
    <!-- http://www.itu.int/oth/T020200009A/en -->
    <territory id="NI" countryCode="505" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[125-8]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1800|
            [25-8]\d{3}
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>2\d{7}</nationalNumberPattern>
      </fixedLine>
      <!-- 55[0-7], 57, 58 and 7[5-8] were added from bug reports/numbers found online. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>81234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            5(?:
              5[0-7]|
              [78]\d
            )|
            6(?:
              20|
              3[035]|
              4[045]|
              5[05]|
              77|
              8[1-9]|
              9[059]
            )|
            (?:
              7[5-8]|
              8\d
            )\d
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>18001234</exampleNumber>
        <nationalNumberPattern>1800\d{4}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Netherlands (NL) -->
    <!-- http://en.wikipedia.org/wiki/%2B31 -->
    <!-- http://wetten.overheid.nl/BWBR0010198 -->
    <territory id="NL" countryCode="31" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Shortcodes (4 digits). -->
        <numberFormat pattern="(\d{4})">
          <leadingDigits>
            1[238]|
            [34]
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- National only numbers (no national prefix). -->
        <numberFormat pattern="(\d{2})(\d{3,4})">
          <leadingDigits>14</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Shortcodes (6 digits). -->
        <numberFormat pattern="(\d{6})">
          <leadingDigits>1</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Toll free & premium rate. -->
        <numberFormat pattern="(\d{3})(\d{4,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]0</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>66</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1[16-8]|
            2[259]|
            3[124]|
            4[17-9]|
            5[124679]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [1-578]|
            91
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For M2M numbers that are used for mobile purposes. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [124-7]\d\d|
            3(?:
              [02-9]\d|
              1[0-8]
            )
          )\d{6}|
          8\d{6,9}|
          9\d{6,10}|
          1\d{4,5}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="5,6"/>
        <nationalNumberPattern>
          140(?:
            1[035]|
            2[0346]|
            3[03568]|
            4[0356]|
            5[0358]|
            8[458]
          )|
          140(?:
            1[16-8]|
            2[259]|
            3[124]|
            4[17-9]|
            5[124679]|
            7
          )\d
        </nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>101234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              [035]\d|
              1[13-578]|
              6[124-8]|
              7[24]|
              8[0-467]
            )|
            2(?:
              [0346]\d|
              2[2-46-9]|
              5[125]|
              9[479]
            )|
            3(?:
              [03568]\d|
              1[3-8]|
              2[01]|
              4[1-8]
            )|
            4(?:
              [0356]\d|
              1[1-368]|
              7[58]|
              8[15-8]|
              9[23579]
            )|
            5(?:
              [0358]\d|
              [19][1-9]|
              2[1-57-9]|
              4[13-8]|
              6[126]|
              7[0-3578]
            )|
            7\d\d
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- As per this government.nl's doc some sub ranges of existing 06[1-58] mobile numbers are
           used for M2M purposes (that use mobile networks). But there is no information about these
           sub ranges. The other way is also true, 12 digit 097 M2M numbers are used for mobile
           purposes. More information in https://www.acm.nl/en/publications/information-about-dutch-097-numbers-non-dutch-providers
           Added support just for subrange 970X as these only mentioned as assigned/live. -->
      <mobile>
        <possibleLengths national="9,11"/>
        <exampleNumber>612345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            6[1-58]|
            970\d
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="9"/>
        <exampleNumber>662345678</exampleNumber>
        <nationalNumberPattern>66\d{7}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="[7-10]"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>800\d{4,7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="[7-10]"/>
        <exampleNumber>9061234</exampleNumber>
        <nationalNumberPattern>90[069]\d{4,7}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>851234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            85|
            91
          )\d{7}
        </nationalNumberPattern>
      </voip>
      <!-- These numbers are used for local government. They are formed by the appending the local
           dialling code (including the national prefix 0) after the leading digits "14".
           government.nl's doc says 88 range is for premium rate services but only for a period of
           6 months after its enforcement. Online results and Wikipedia says these are of standard
           cost to end users. -->
      <uan>
        <possibleLengths national="5,6,9"/>
        <exampleNumber>14020</exampleNumber>
        <nationalNumberPattern>
          140(?:
            1[035]|
            2[0346]|
            3[03568]|
            4[0356]|
            5[0358]|
            8[458]
          )|
          (?:
            140(?:
              1[16-8]|
              2[259]|
              3[124]|
              4[17-9]|
              5[124679]|
              7
            )|
            8[478]\d{6}
          )\d
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Norway (NO) -->
    <!-- Main region for 'SJ' -->
    <!-- Metadata (excluding fixed-line) should be duplicated in 'SJ'. -->
    <!-- http://www.npt.no/npt/numsys/E.164.pdf -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Norway -->
    <territory id="NO" mainCountryForCode="true" countryCode="47" leadingDigits="[02-689]|7[0-8]"
               internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[2-79]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            0|
            [2-9]\d{3}
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Excludes Svalbard fixed-line numbers. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[1-4]|
            3[1-3578]|
            5[1-35-7]|
            6[1-4679]|
            7[0-8]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Consider adding one more digit for stricter validation (e.g. for 580). TETRA and GSM-R
           numbers are not supported as they are not reachable for all. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>40612345</exampleNumber>
        <nationalNumberPattern>
          (?:
            4[015-8]|
            9\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>80[01]\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>82012345</exampleNumber>
        <nationalNumberPattern>82[09]\d{5}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>81021234</exampleNumber>
        <nationalNumberPattern>
          810(?:
            0[0-6]|
            [2-8]\d
          )\d{3}
        </nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>88012345</exampleNumber>
        <nationalNumberPattern>880\d{5}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>85012345</exampleNumber>
        <nationalNumberPattern>85[0-5]\d{5}</nationalNumberPattern>
      </voip>
      <!-- Includes some 810 local-rate numbers, and long-distance rate numbers. -->
      <uan>
        <possibleLengths national="5,8"/>
        <exampleNumber>02000</exampleNumber>
        <nationalNumberPattern>
          (?:
            0[2-9]|
            81(?:
              0(?:
                0[7-9]|
                1\d
              )|
              5\d\d
            )
          )\d{3}
        </nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="8"/>
        <exampleNumber>81212345</exampleNumber>
        <nationalNumberPattern>81[23]\d{5}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Nepal (NP) -->
    <!-- http://www.itu.int/oth/T0202000095/en -->
    <!-- http://www.ntc.net.np/mobile/mob_postpaid_number_scheme.php -->
    <!-- http://www.nta.gov.np/en/2012-06-01-11-45-17/2012-06-04-04-26-59/numbering-plan -->
    <territory id="NP" countryCode="977" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- Formatting patterns taken from pages like http://www.nepalgov.gov.np -->
        <numberFormat pattern="(\d)(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1[2-6]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1[01]|
            [2-8]|
            9(?:
              [1-59]|
              [67][2-6]
            )
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{7})">
          <leadingDigits>9</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- 11 digit toll free number -->
        <numberFormat pattern="(\d{4})(\d{2})(\d{5})">
          <leadingDigits>1</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1\d|
            9
          )\d{9}|
          [1-9]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- We don't support Rural Telecommunication Service at the moment since
           we are not sure what type it is. -->
      <fixedLine>
        <possibleLengths national="8" localOnly="6,7"/>
        <exampleNumber>14567890</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[0-6]\d|
            99[02-6]
          )\d{5}|
          (?:
            2[13-79]|
            3[135-8]|
            4[146-9]|
            5[135-7]|
            6[13-9]|
            7[15-9]|
            8[1-46-9]|
            9[1-7]
          )[2-6]\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added prefix 982 per IR21 from the carrier. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>9841234567</exampleNumber>
        <nationalNumberPattern>
          9(?:
            00|
            6[0-3]|
            7[024-6]|
            8[0-24-68]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- Added prefix 166001 based on https://ntc.net.np/post/toll-free-phone.
           Prefix 1800 is added based on user report. -->
      <tollFree>
        <possibleLengths national="11"/>
        <exampleNumber>16600101234</exampleNumber>
        <nationalNumberPattern>
          1(?:
            66001|
            800\d\d
          )\d{5}
        </nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Nauru (NR) -->
    <!-- http://www.itu.int/oth/T0202000094/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Nauru -->
    <territory id="NR" countryCode="674" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[4-68]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            444|
            (?:
              55|
              8\d
            )\d|
            666
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>4441234</exampleNumber>
        <nationalNumberPattern>444\d{4}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>5551234</exampleNumber>
        <nationalNumberPattern>
          (?:
            55[3-9]|
            666|
            8\d\d
          )\d{4}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Niue (NU) -->
    <!-- http://www.itu.int/oth/T02020000EC/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Niue -->
    <territory id="NU" countryCode="683" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [4-7]|
            888\d
          )\d{3}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="4"/>
        <exampleNumber>7012</exampleNumber>
        <nationalNumberPattern>[47]\d{3}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="4,7"/>
        <exampleNumber>8884012</exampleNumber>
        <nationalNumberPattern>
          (?:
            [56]|
            888[1-9]
          )\d{3}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- New Zealand (NZ) -->
    <!-- Includes Ross Dependency, Antarctica -->
    <!-- Does not currently support 083 "Enhanced voice services", New Zealand direct service
         numbers and 050 "Nation-Wide Service". -->
    <!-- http://www.itu.int/oth/T0202000099/en -->
    <territory id="NZ" countryCode="64" preferredInternationalPrefix="00"
               internationalPrefix="0(?:0|161)" nationalPrefix="0" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Enhanced voice services -->
        <numberFormat pattern="(\d{2})(\d{3,8})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8[1-79]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 7, 8-digit variable cost (premium rate/toll free). -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            50[036-8]|
            8|
            90
          </leadingDigits>
          <leadingDigits>
            50(?:
              [0367]|
              88
            )|
            8|
            90
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Pattern for fixed-line formats, including Ross Dependency. -->
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            24|
            [346]|
            7[2-57-9]|
            9[2-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 0274, 0210 and toll-free/premium-rate prefixes 0508/0800/0900. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            2(?:
              10|
              74
            )|
            [589]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 2Degrees numbers are formatted with 022 separated, since this seems to be more common
             than writing the first group as 022X based on Google web searches, and is used by
             2Degrees themselves. See formatting on http://www.2degreesmobile.co.nz for an example
             of the latter. We follow the same pattern for 020 (Orcon) and 028 (mixed) numbers. -->
        <numberFormat pattern="(\d{2})(\d{3,4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1|
            2[028]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile numbers do not have exclusive leading digits - formatting depends on number length.
             Vodafone numbers can be 8 digits (without leading 0)."
             Paging numbers and some mobile numbers (Telecom/Vodafone/TelstraClear). -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            2(?:
              [169]|
              7[0-35-9]
            )|
            7
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1289]\d{9}|
          50\d{5}(?:
            \d{2,3}
          )?|
          [27-9]\d{7,8}|
          (?:
            [34]\d|
            6[0-35-9]
          )\d{6}|
          8\d{4,6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8" localOnly="7"/>
        <exampleNumber>32345678</exampleNumber>
        <nationalNumberPattern>
          24099\d{3}|
          (?:
            3[2-79]|
            [49][2-9]|
            6[235-9]|
            7[2-57-9]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Includes mobile radio service numbers (e.g. TeamTalk). -->
      <mobile>
        <possibleLengths national="[8-10]"/>
        <exampleNumber>211234567</exampleNumber>
        <nationalNumberPattern>
          2(?:
            [0-27-9]\d|
            6
          )\d{6,7}|
          2(?:
            1\d|
            75
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- These are the toll free patterns used, by Telecom and Telstra/Clear, but they are
           referred to as 'Value-added service' in the phone plan for some reason. 85 numbers are
           not covered, as telecom companies don't seem to support them yet. -->
      <tollFree>
        <possibleLengths national="[8-10]"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>
          508\d{6,7}|
          80\d{6,8}
        </nationalNumberPattern>
      </tollFree>
      <!-- The ITU doc says the lengths are 9 to 11, but wikipedia says 8. Online numbers can only
           be found with lengths 8 and 9. 7 digit 'Nation-Wide Service' numbers are also included
           here. -->
      <premiumRate>
        <possibleLengths national="[7-10]"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[13-57-9]\d{5}|
            50(?:
              0[08]|
              30|
              66|
              77|
              88
            )
          )\d{3}|
          90\d{6,8}
        </nationalNumberPattern>
      </premiumRate>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>701234567</exampleNumber>
        <nationalNumberPattern>70\d{7}</nationalNumberPattern>
      </personalNumber>
      <uan>
        <possibleLengths national="[5-10]"/>
        <exampleNumber>83012378</exampleNumber>
        <nationalNumberPattern>
          8(?:
            1[16-9]|
            22|
            3\d|
            4[045]|
            5[459]|
            6[235-9]|
            7[0-3579]|
            90
          )\d{2,7}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Oman (OM) -->
    <!-- http://www.itu.int/oth/T020200009F/en -->
    <territory id="OM" countryCode="968" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4,6})">
          <leadingDigits>[58]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[179]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1505|
            [279]\d{3}|
            500
          )\d{4}|
          800\d{5,6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>23123456</exampleNumber>
        <nationalNumberPattern>2[1-6]\d{6}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>92123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            1505|
            90[1-9]\d
          )\d{4}|
          (?:
            7[126-9]|
            9[1-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <!-- Link to document about toll-free numbers on http://www.tra.gov.om, which suggests they
           should be 8007 followed by 4 digits. However, the only examples I can find, including
           the customer help line for the main telephony company there (omantel), is 8007 followed
           by 5 digits, so am allowing both for now to be on the safe side. 500 numbers seem to
           offer international toll-free dialing numbers - +968 500 1300 for international help
           desk for omantel, for example. Toll-free numbers 800[05] are added based on user report
           and not official docs. -->
      <tollFree>
        <possibleLengths national="[7-9]"/>
        <exampleNumber>80071234</exampleNumber>
        <nationalNumberPattern>
          8007\d{4,5}|
          (?:
            500|
            800[05]
          )\d{4}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90012345</exampleNumber>
        <nationalNumberPattern>900\d{5}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Panama (PA) -->
    <!-- Last read July 9, 2014. -->
    <!-- Omits the fact that mobile phones are 8 digits long. -->
    <!-- http://www.asep.gob.pa/telecom/pnn/default.asp -->
    <!-- http://en.wikipedia.org/wiki/%2B507 -->
    <territory id="PA" countryCode="507" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[1-57-9]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[68]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            00800|
            8\d{3}
          )\d{6}|
          [68]\d{7}|
          [1-57-9]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Note that numbers starting with 101, 106, 131, 151, 156 and 168 have not been assigned
           to any rule below since we are not sure what the "servicios 102/103" refer to here. -->
      <!-- Note that "servicios 101/104" in the plan refer to "Local Basic Communications Service"
           and "Public and Semipublic Terminal Service", represented here as fixed-line. -->
      <!-- The range 194-XXXX has been added since a number was found online with this prefix and
           proved to be diallable. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2001234</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              0\d|
              1[479]|
              2[37]|
              3[0137]|
              4[17]|
              5[05]|
              6[058]|
              7[0167]|
              8[2358]|
              9[1389]
            )|
            2(?:
              [0235-79]\d|
              1[0-7]|
              4[013-9]|
              8[02-9]
            )|
            3(?:
              [089]\d|
              1[0-7]|
              2[0-5]|
              33|
              4[0-79]|
              5[0-35]|
              6[068]|
              7[0-8]
            )|
            4(?:
              00|
              3[0-579]|
              4\d|
              7[0-57-9]
            )|
            5(?:
              [01]\d|
              2[0-7]|
              [56]0|
              79
            )|
            7(?:
              0[09]|
              2[0-26-8]|
              3[03]|
              4[04]|
              5[05-9]|
              6[0156]|
              7[0-24-9]|
              8[5-9]|
              90
            )|
            8(?:
              09|
              2[89]|
              3\d|
              4[0-24-689]|
              5[014]|
              8[02]
            )|
            9(?:
              0[5-9]|
              1[0135-8]|
              2[036-9]|
              3[35-79]|
              40|
              5[0457-9]|
              6[05-9]|
              7[04-9]|
              8[35-8]|
              9\d
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Note that "servicios 106/107" in the plan refer to mobile services. We also include
           service "210", "Servicio de Busca Personas". -->
      <mobile>
        <possibleLengths national="7,8"/>
        <exampleNumber>61234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[16]1|
            21[89]|
            6\d{3}|
            8(?:
              1[01]|
              7[23]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- Prefix 800 and 00800 of length 9-digit and 11-digit is added based on user
           report.  -->
      <tollFree>
        <possibleLengths national="7,8,10,11"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>
          800\d{4,5}|
          (?:
            00800|
            800\d
          )\d{6}
        </nationalNumberPattern>
      </tollFree>
      <!-- Value-added services are represented as "400" in the plan. -->
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>8601234</exampleNumber>
        <nationalNumberPattern>
          (?:
            8(?:
              22|
              55|
              60|
              7[78]|
              86
            )|
            9(?:
              00|
              81
            )
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Peru (PE) -->
    <!-- http://www.itu.int/oth/T02020000A6/en -->
    <!-- http://en.wikipedia.org/wiki/+51 -->
    <!-- http://www.assistbook.com/South%20America/Peru/widecodes -->
    <territory id="PE" countryCode="51" preferredInternationalPrefix="00"
               internationalPrefix="00|19(?:1[124]|77|90)00" nationalPrefix="0"
               preferredExtnPrefix=" Anexo " mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>80</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{7})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>[4-8]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Formatting from common usage found on the internet, supported by ITU doc. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [14-8]|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Looks like not all 1X numbers are land-line numbers in Lima, some of them are allotted
           as IDDs. As it effects parsing of these numbers and no valid numbers found online, not
           supporting 8 digit 191[124], 1977 and 1990 ranges. -->
      <fixedLine>
        <possibleLengths national="8" localOnly="6,7"/>
        <exampleNumber>11234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              4[34]|
              5[14]
            )[0-8]\d|
            7(?:
              173|
              3[0-8]\d
            )|
            8(?:
              10[05689]|
              6(?:
                0[06-9]|
                1[6-9]|
                29
              )|
              7(?:
                0[569]|
                [56]0
              )
            )
          )\d{4}|
          (?:
            1[0-8]|
            4[12]|
            5[236]|
            6[1-7]|
            7[246]|
            8[2-4]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>9\d{8}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>800\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>80512345</exampleNumber>
        <nationalNumberPattern>805\d{5}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>80112345</exampleNumber>
        <nationalNumberPattern>801\d{5}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>80212345</exampleNumber>
        <nationalNumberPattern>80[24]\d{5}</nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- French Polynesia (PF) -->
    <!-- http://www.itu.int/oth/T020200004D/en -->
    <territory id="PF" countryCode="689" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})">
          <leadingDigits>44</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            4|
            8[7-9]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          4\d{5}(?:
            \d{2}
          )?|
          8\d{7,8}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="6"/>
        <nationalNumberPattern>44\d{4}</nationalNumberPattern>
      </noInternationalDialling>
      <!-- Includes payphone prefixes. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>40412345</exampleNumber>
        <nationalNumberPattern>
          4(?:
            0[4-689]|
            9[4-68]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>87123456</exampleNumber>
        <nationalNumberPattern>8[7-9]\d{6}</nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as Toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>49901234</exampleNumber>
        <nationalNumberPattern>499\d{5}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="6"/>
        <exampleNumber>440123</exampleNumber>
        <nationalNumberPattern>44\d{4}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Papua New Guinea (PG) -->
    <!-- http://www.itu.int/oth/T02020000A4/en -->
    <!-- http://en.wikipedia.org/wiki/%2B675 -->
    <!-- http://nicta.gov.pg/search?searchword=numbering%20plan -->
    <territory id="PG" countryCode="675" preferredInternationalPrefix="00"
               internationalPrefix="00|140[1-3]">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            18|
            [2-69]|
            85
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[78]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            180|
            [78]\d{3}
          )\d{4}|
          (?:
            [2-589]\d|
            64
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>3123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              3[0-2]|
              4[257]|
              5[34]|
              9[78]
            )\d|
            64[1-9]|
            85[02-46-9]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>70123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            7\d|
            8[1-38]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="7"/>
        <exampleNumber>2700123</exampleNumber>
        <nationalNumberPattern>27[01]\d{4}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>1801234</exampleNumber>
        <nationalNumberPattern>180\d{4}</nationalNumberPattern>
      </tollFree>
      <!-- Including all satellite numbers from the ITU doc here, as we found working numbers
           online. -->
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>2751234</exampleNumber>
        <nationalNumberPattern>
          2(?:
            0[0-57]|
            7[568]
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Philippines (PH) -->
    <!-- http://en.wikipedia.org/wiki/%2B63 -->
    <territory id="PH" countryCode="63" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4,6})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            3(?:
              23|
              39|
              46
            )|
            4(?:
              2[3-6]|
              [35]9|
              4[26]|
              76
            )|
            544|
            88[245]|
            (?:
              52|
              64|
              86
            )2
          </leadingDigits>
          <leadingDigits>
            3(?:
              230|
              397|
              461
            )|
            4(?:
              2(?:
                35|
                [46]4|
                51
              )|
              396|
              4(?:
                22|
                63
              )|
              59[347]|
              76[15]
            )|
            5(?:
              221|
              446
            )|
            642[23]|
            8(?:
              622|
              8(?:
                [24]2|
                5[13]
              )
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{5})(\d{4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            346|
            4(?:
              27|
              9[35]
            )|
            883
          </leadingDigits>
          <leadingDigits>
            3469|
            4(?:
              279|
              9(?:
                30|
                56
              )
            )|
            8834
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            [3-7]|
            8[2-8]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Formatting from http://www.uniontelecard.com/calling-guides/philippines/guide1.aspx -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{1,2})(\d{3})(\d{4})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-7]|
            9\d
          )\d{8}|
          2\d{5}|
          (?:
            1800|
            8
          )\d{7,9}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Evidence on number length is hard to come by. We have found diallable numbers in Manila
           that have only 5 digits after the area code; plus it seems the 8822 area code is
           followed by 6 digits, and 8842 by only 4. Subscriber number of area code 02 are migrated
           from 7 digit to 8 digit since 6th October 2019. -->
      <fixedLine>
        <possibleLengths national="6,[8-10]" localOnly="4,5,7"/>
        <exampleNumber>232345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              2[3-8]|
              3[2-68]|
              4[2-9]|
              5[2-6]|
              6[2-58]|
              7[24578]
            )\d{3}|
            88(?:
              22\d\d|
              42
            )
          )\d{4}|
          (?:
            2|
            8[2-8]\d\d
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 950 added based on info received from Smart. 96[5-7] added based on user report. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>9051234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            8(?:
              1[37]|
              9[5-8]
            )|
            9(?:
              0[5-9]|
              1[0-24-9]|
              [235-7]\d|
              4[2-9]|
              8[135-9]|
              9[1-9]
            )
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- Information on toll-free numbers collected from searching the internet -->
      <tollFree>
        <possibleLengths national="[11-13]"/>
        <exampleNumber>180012345678</exampleNumber>
        <nationalNumberPattern>1800\d{7,9}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Pakistan (PK) -->
    <!-- http://www.itu.int/oth/T02020000A1/en -->
    <!-- http://en.wikipedia.org/wiki/%2B92 -->
    <territory id="PK" countryCode="92" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Toll-free and premium-rate numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2,7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Personal numbers.
             https://propakistani.pk/2010/06/10/ptcl-launches-personal-global-number/ has it
             listed as being dialled without the national prefix. -->
        <numberFormat pattern="(\d{4})(\d{5})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed-line numbers with 3 digits in first group. -->
        <numberFormat pattern="(\d{3})(\d{6,7})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2(?:
              3[2358]|
              4[2-4]|
              9[2-8]
            )|
            45[3479]|
            54[2-467]|
            60[468]|
            72[236]|
            8(?:
              2[2-689]|
              3[23578]|
              4[3478]|
              5[2356]
            )|
            9(?:
              2[2-8]|
              3[27-9]|
              4[2-6]|
              6[3569]|
              9[25-8]
            )
          </leadingDigits>
          <leadingDigits>
            9(?:
              2[3-8]|
              98
            )|
            (?:
              2(?:
                3[2358]|
                4[2-4]|
                9[2-8]
              )|
              45[3479]|
              54[2-467]|
              60[468]|
              72[236]|
              8(?:
                2[2-689]|
                3[23578]|
                4[3478]|
                5[2356]
              )|
              9(?:
                22|
                3[27-9]|
                4[2-6]|
                6[3569]|
                9[25-7]
              )
            )[2-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed-line numbers with 2 digits in first group. -->
        <numberFormat pattern="(\d{2})(\d{7,8})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            (?:
              2[125]|
              4[0-246-9]|
              5[1-35-7]|
              6[1-8]|
              7[14]|
              8[16]|
              91
            )[2-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed-line numbers with 5 digits in first group.
             586 was seen in this format online.
             581 and 582 are added here because our best is guess is they behave like 586, given
             these are the only fixed-line numbers where the second group doesn't start with [2-9]. -->
        <numberFormat pattern="(\d{5})(\d{5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>58</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Mobile numbers. -->
        <numberFormat pattern="(\d{3})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 11-digit UAN numbers (formatted to imply an area code but since there's not enough evidence that
             the first group is actually optional, we don't assign an area code length to these ranges yet). -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2[125]|
            4[0-246-9]|
            5[1-35-7]|
            6[1-8]|
            7[14]|
            8[16]|
            91
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- 12-digit UAN numbers (formatted to imply an area code but it's not optional). -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>[24-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          122\d{6}|
          [24-8]\d{10,11}|
          9(?:
            [013-9]\d{8,10}|
            2(?:
              [01]\d\d|
              2(?:
                [06-8]\d|
                1[01]
              )
            )\d{7}
          )|
          (?:
            [2-8]\d{3}|
            92(?:
              [0-7]\d|
              8[1-9]
            )
          )\d{6}|
          [24-9]\d{8}|
          [89]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The subscriber number length is not well defined for some area codes. From online
           examples, we have come up with a heuristic that for 3-digit area codes, the subscriber
           number will be 6 or 7 digits - for 2-digit area codes it will be 7, with the exceptions
           of Karachi and Lahore (both 8). -->
      <fixedLine>
        <possibleLengths national="9,10" localOnly="[5-8]"/>
        <exampleNumber>2123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              21|
              42
            )[2-9]|
            58[126]
          )\d{7}|
          (?:
            2[25]|
            4[0146-9]|
            5[1-35-7]|
            6[1-8]|
            7[14]|
            8[16]|
            91
          )[2-9]\d{6,7}|
          (?:
            2(?:
              3[2358]|
              4[2-4]|
              9[2-8]
            )|
            45[3479]|
            54[2-467]|
            60[468]|
            72[236]|
            8(?:
              2[2-689]|
              3[23578]|
              4[3478]|
              5[2356]
            )|
            9(?:
              2[2-8]|
              3[27-9]|
              4[2-6]|
              6[3569]|
              9[25-8]
            )
          )[2-9]\d{5,6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 325 and 320 as SMSs have been successfully sent to these numbers and numbers
           can be found online with these prefixes. Added 348 based on information found
           online. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>3012345678</exampleNumber>
        <nationalNumberPattern>
          3(?:
            [0-247]\d|
            3[0-79]|
            55|
            64
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- Prefix 800 (11 digits) added based on user report. -->
      <tollFree>
        <possibleLengths national="8,11"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>
          800\d{5}(?:
            \d{3}
          )?
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90012345</exampleNumber>
        <nationalNumberPattern>900\d{5}</nationalNumberPattern>
      </premiumRate>
      <!-- These are referred to as UPT numbers in the plan. -->
      <!-- The example number here is the test number from the plan. -->
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>122044444</exampleNumber>
        <nationalNumberPattern>122\d{6}</nationalNumberPattern>
      </personalNumber>
      <!-- Data on what a UAN is is hard to come by. http://www.ptcl.com.pk has information under
           http://www.ptcl.com.pk/contentb.php?NID=143#uan - which defines their format - but not
           what type of number they are. We exclude Azad Jammu, Kashmir and Northern Areas here
           since no online example UANs can be found, and they have an "access code" at the start,
           making it difficult to guess what a UAN in these areas would look like. -->
      <uan>
        <possibleLengths national="11,12"/>
        <exampleNumber>21111825888</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              [125]|
              3[2358]|
              4[2-4]|
              9[2-8]
            )|
            4(?:
              [0-246-9]|
              5[3479]
            )|
            5(?:
              [1-35-7]|
              4[2-467]
            )|
            6(?:
              0[468]|
              [1-8]
            )|
            7(?:
              [14]|
              2[236]
            )|
            8(?:
              [16]|
              2[2-689]|
              3[23578]|
              4[3478]|
              5[2356]
            )|
            9(?:
              1|
              22|
              3[27-9]|
              4[2-6]|
              6[3569]|
              9[2-7]
            )
          )111\d{6}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Poland (PL) -->
    <!-- Source is in Polish. -->
    <!-- http://en.wikipedia.org/wiki/%2B48 -->
    <!-- http://www.itu.int/oth/T02020000A8/en -->
    <!-- http://www.uke.gov.pl/tablice/home.do?execution=e1s1 -->
    <!-- http://www.sgwp.wp.mil.pl/pl/1_1225.html -->
    <territory id="PL" countryCode="48" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 5-digit shortcodes. -->
        <numberFormat pattern="(\d{5})">
          <leadingDigits>19</leadingDigits>
          <format>$1</format>
        </numberFormat>
        <!-- 6-digit shortcodes and other ranges (e.g. pager). -->
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>
            11|
            20|
            64
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 7-digit fixed-line numbers. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})">
          <leadingDigits>
            (?:
              1[2-8]|
              2[2-69]|
              3[2-4]|
              4[1-468]|
              5[24-689]|
              6[1-3578]|
              7[14-7]|
              8[1-79]|
              9[145]
            )1
          </leadingDigits>
          <leadingDigits>
            (?:
              1[2-8]|
              2[2-69]|
              3[2-4]|
              4[1-468]|
              5[24-689]|
              6[1-3578]|
              7[14-7]|
              8[1-79]|
              9[145]
            )19
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 7-8 digit pager numbers. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2,3})">
          <leadingDigits>64</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile, pager and a few fixed-line numbers.
             (70 numbers are formatted as per mobile numbers, based on information from some Polish people). -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>
            21|
            39|
            45|
            5[0137]|
            6[0469]|
            7[02389]|
            8(?:
              0[14]|
              8
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 9-digit fixed-line numbers. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})">
          <leadingDigits>
            1[2-8]|
            [2-7]|
            8[1-79]|
            9[145]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- 9-10 digit toll free numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            6|
            8\d\d
          )\d{7}|
          [1-9]\d{6}(?:
            \d{2}
          )?|
          [26]\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The plan says all geographical numbers are 9 digits; but we found customer service
           numbers 19XXX that can be diallable along with valid area code and are 7 digits
           instead, so we support those numbers too. See:
           http://www.polskasiectaxi.pl/pst/pst-partnerzy.
           Numbers which start with 26 are allocated for the military, see:
           http://www.sgwp.wp.mil.pl/pl/1_1225.html.
           Numbers which start with 47 are allocated for police, see:
           https://policja.pl/pol/aktualnosci/185570,Uwaga-Zmieniaja-sie-numery-telefonow-do-jednostek-Policji-w-calym-kraju.html -->
      <fixedLine>
        <possibleLengths national="7,9"/>
        <exampleNumber>123456789</exampleNumber>
        <nationalNumberPattern>
          47\d{7}|
          (?:
            1[2-8]|
            2[2-69]|
            3[2-4]|
            4[1-468]|
            5[24-689]|
            6[1-3578]|
            7[14-7]|
            8[1-79]|
            9[145]
          )(?:
            [02-9]\d{6}|
            1(?:
              [0-8]\d{5}|
              9\d{3}(?:
                \d{2}
              )?
            )
          )
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>512345678</exampleNumber>
        <nationalNumberPattern>
          21(?:
            1[013-5]|
            2\d
          )\d{5}|
          (?:
            45|
            5[0137]|
            6[069]|
            7[2389]|
            88
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="[6-9]"/>
        <exampleNumber>641234567</exampleNumber>
        <nationalNumberPattern>64\d{4,7}</nationalNumberPattern>
      </pager>
      <!-- Prefix 800 with 10 digits added based on user report. -->
      <tollFree>
        <possibleLengths national="9,10"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6,7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>701234567</exampleNumber>
        <nationalNumberPattern>70[01346-8]\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>801\d{6}</nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>391234567</exampleNumber>
        <nationalNumberPattern>39\d{7}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>804123456</exampleNumber>
        <nationalNumberPattern>804\d{6}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- St. Pierre & Miquelon (PM) -->
    <!-- http://www.itu.int/oth/T02020000B2/en -->
    <territory id="PM" countryCode="508" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[45]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [45]\d{5}|
          (?:
            708|
            80\d
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Fixed-line and mobile numbers do not include any main prefix (like country code)
           before subscriber number unlike other French territories as they can be dialled
           directly using subscriber number after country code in E.164 format. 4[23] and 50
           ranges are added to both fixed-line and mobile categories as it is not clear in ITU
           doc. -->
      <fixedLine>
        <possibleLengths national="6"/>
        <exampleNumber>430123</exampleNumber>
        <nationalNumberPattern>
          (?:
            4[1-35-7]|
            5[01]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 44 XXXX might be a mobile range as it is assigned to Globaltel. Category is not
           mentioned in the ITU doc. -->
      <mobile>
        <possibleLengths national="6,9"/>
        <exampleNumber>551234</exampleNumber>
        <nationalNumberPattern>
          (?:
            4[02-4]|
            5[056]|
            708[45][0-5]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as Toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Puerto Rico (PR) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000AA/en -->
    <territory id="PR" countryCode="1" leadingDigits="787|939" internationalPrefix="011"
               nationalPrefix="1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [589]\d\d|
            787
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7872345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            787|
            939
          )[2-9]\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7872345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            787|
            939
          )[2-9]\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Palestine (PS) -->
    <!-- Palestinian phone numbers can be reached through the Israeli country code (972) in addition
         to the Palestinian country code (970) and so Palestinian landlines and mobile lines are a
         subset of the Israeli formats. -->
    <!-- http://en.wikipedia.org/wiki/%2B970 -->
    <!-- http://www.wtng.info/wtng-970-ps.html -->
    <!-- http://www.paltel.ps -->
    <territory id="PS" countryCode="970" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2489]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>5</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [2489]2\d{6}|
          (?:
            1\d|
            5
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8" localOnly="7"/>
        <exampleNumber>22234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            22[2-47-9]|
            42[45]|
            82[014-68]|
            92[3569]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>599123456</exampleNumber>
        <nationalNumberPattern>5[69]\d{7}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>1800\d{6}</nationalNumberPattern>
      </tollFree>
      <sharedCost>
        <possibleLengths national="10"/>
        <exampleNumber>1700123456</exampleNumber>
        <nationalNumberPattern>1700\d{6}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Portugal (PT) -->
    <!-- http://www.anacom.pt/render.jsp?categoryId=279098 -->
    <territory id="PT" countryCode="351" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Note: the wikipedia page suggests that mobile numbers may also be formatted with only
             two digits in the first group; however, this doesn't seem to be majority usage based on
             searches online. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>2[12]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>
            16|
            [236-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          1693\d{5}|
          (?:
            [26-9]\d|
            30
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>212345678</exampleNumber>
        <nationalNumberPattern>
          2(?:
            [12]\d|
            3[1-689]|
            4[1-59]|
            [57][1-9]|
            6[1-35689]|
            8[1-69]|
            9[1256]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>
          6(?:
            [06]92(?:
              30|
              9\d
            )|
            [35]92(?:
              3[034]|
              9\d
            )
          )\d{3}|
          (?:
            (?:
              16|
              6[0356]
            )93|
            9(?:
              [1-36]\d\d|
              480
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="9"/>
        <exampleNumber>622212345</exampleNumber>
        <nationalNumberPattern>
          6(?:
            222\d|
            8988
          )\d{4}
        </nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>80[02]\d{6}</nationalNumberPattern>
      </tollFree>
      <!-- Fixed maximum cost numbers: 761=0.60€, 761=1€, 762=2€. -->
      <!-- Audio Text prefixes 601,607,608,646 and 648 added here -->
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>760123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            6(?:
              0[178]|
              4[68]
            )\d|
            76(?:
              0[1-57]|
              1[2-47]|
              2[237]
            )
          )\d{5}
        </nationalNumberPattern>
      </premiumRate>
      <!-- 808 are priced as local calls, 809 are national calls. -->
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>808123456</exampleNumber>
        <nationalNumberPattern>
          80(?:
            8\d|
            9[1579]
          )\d{5}
        </nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>884123456</exampleNumber>
        <nationalNumberPattern>884[0-4689]\d{5}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>301234567</exampleNumber>
        <nationalNumberPattern>30\d{7}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>707123456</exampleNumber>
        <nationalNumberPattern>
          70(?:
            38[01]|
            596|
            (?:
              7\d|
              8[17]
            )\d
          )\d{4}
        </nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="9"/>
        <exampleNumber>600110000</exampleNumber>
        <nationalNumberPattern>
          600\d{6}|
          6[06]923[34]\d{3}
        </nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Palau (PW) -->
    <!-- http://www.itu.int/oth/T02020000A2/en -->
    <territory id="PW" countryCode="680" internationalPrefix="01[12]">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [24-8]\d\d|
            345|
            900
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 900XXXX is mentioned as fixed-line and "PNCC/Operator Services". Might be carrier
           specific services of PNCC network. As we do not have carrier specific category in phone
           metadata, adding support to it here. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2771234</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              55|
              77
            )|
            345|
            488|
            5(?:
              35|
              44|
              87
            )|
            6(?:
              22|
              54|
              79
            )|
            7(?:
              33|
              47
            )|
            8(?:
              24|
              55|
              76
            )|
            900
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>6201234</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              46|
              83
            )[0-5]|
            6[2-4689]0
          )\d{4}|
          (?:
            45|
            77|
            88
          )\d{5}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Paraguay (PY) -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Paraguay -->
    <!-- http://www.itu.int/oth/T02020000A5/en -->
    <!-- http://www.copaco.com.py/portal/index.php/component/content/article/8-empresa/74-codigos-de-area.html -->
    <!-- Number formats of landline numbers are based on online references. -->
    <territory id="PY" countryCode="595" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-9]0</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 7-digit fixed line -->
        <numberFormat pattern="(\d{2})(\d{5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            [26]1|
            3[289]|
            4[1246-8]|
            7[1-3]|
            8[1-36]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 7 or 8-digit fixed line numbers (without a 9-digit variant) -->
        <numberFormat pattern="(\d{3})(\d{4,5})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2[279]|
            3[13-5]|
            4[359]|
            5|
            6(?:
              [34]|
              7[1-46-8]
            )|
            7[46-8]|
            85
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 8 or 9-digit fixed line numbers where a 7-digit variant exists -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            2[14-68]|
            3[26-9]|
            4[1246-8]|
            6(?:
              1|
              75
            )|
            7[1-35]|
            8[1-36]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format seen in examples found online. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>87</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            9(?:
              [5-79]|
              8[1-7]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-8]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 11 digit toll free numbers -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          59\d{4,6}|
          9\d{5,10}|
          (?:
            [2-46-8]\d|
            5[0-8]
          )\d{4,7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="[7-9]" localOnly="5,6"/>
        <exampleNumber>212345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            [26]1|
            3[289]|
            4[1246-8]|
            7[1-3]|
            8[1-36]
          )\d{5,7}|
          (?:
            2(?:
              2[4-68]|
              [4-68]\d|
              7[15]|
              9[1-5]
            )|
            3(?:
              18|
              3[167]|
              4[2357]|
              51|
              [67]\d
            )|
            4(?:
              3[12]|
              5[13]|
              9[1-47]
            )|
            5(?:
              [1-4]\d|
              5[02-4]
            )|
            6(?:
              3[1-3]|
              44|
              7[1-8]
            )|
            7(?:
              4[0-4]|
              5\d|
              6[1-578]|
              75|
              8[0-8]
            )|
            858
          )\d{5,6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>961456789</exampleNumber>
        <nationalNumberPattern>
          9(?:
            51|
            6[129]|
            7[1-6]|
            8[1-7]|
            9[1-5]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[9-11]"/>
        <exampleNumber>98000123456</exampleNumber>
        <nationalNumberPattern>9800\d{5,7}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>870012345</exampleNumber>
        <nationalNumberPattern>8700[0-4]\d{4}</nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="[6-9]"/>
        <exampleNumber>201234567</exampleNumber>
        <nationalNumberPattern>[2-9]0\d{4,7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Qatar (QA) -->
    <!-- No premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T02020000AB/en -->
    <!-- http://wtng.info/wtng-qq.html -->
    <territory id="QA" countryCode="974" internationalPrefix="00" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            2[16]|
            8
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[3-7]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          800\d{4}|
          (?:
            2|
            800
          )\d{6}|
          (?:
            0080|
            [3-7]
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The prefix 40 has now been allocated, based on numbers seen online.
           Prefix 414[1-4] is added based on user report and online numbers. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>44123456</exampleNumber>
        <nationalNumberPattern>
          4(?:
            1111|
            2022
          )\d{3}|
          4(?:
            [04]\d\d|
            14[0-6]|
            999
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>33123456</exampleNumber>
        <nationalNumberPattern>[35-7]\d{7}</nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="7"/>
        <exampleNumber>2123456</exampleNumber>
        <nationalNumberPattern>2[16]\d{5}</nationalNumberPattern>
      </pager>
      <!-- Prefix 800 with 9 digit length is added based on user report. -->
      <tollFree>
        <possibleLengths national="7,9,11"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>
          800\d{4}|
          (?:
            0080[01]|
            800
          )\d{6}
        </nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Réunion (RE) -->
    <!-- Main region for 'YT' -->
    <!-- http://www.itu.int/oth/T020200004B/en -->
    <!-- http://www.arcep.fr/index.php?id=2137&bloc=0596&CMD=RESULTS_NUMEROTATION -->
    <territory id="RE" mainCountryForCode="true" countryCode="262" internationalPrefix="00"
               nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2689]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            26|
            [689]\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- 0876 numbers are mentioned in the plan, but none in use can be found. -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>262161234</exampleNumber>
        <nationalNumberPattern>
          26(?:
            2\d\d|
            3(?:
              0\d|
              1[0-6]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>692123456</exampleNumber>
        <nationalNumberPattern>
          69(?:
            2\d\d|
            3(?:
              [06][0-6]|
              1[013]|
              2[0-2]|
              3[0-39]|
              4\d|
              5[0-5]|
              7[0-37]|
              8[0-8]|
              9[0-479]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- 08* Numbers in Réunion are the same as those valid in France. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>891123456</exampleNumber>
        <nationalNumberPattern>89[1-37-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>810123456</exampleNumber>
        <nationalNumberPattern>
          8(?:
            1[019]|
            2[0156]|
            84|
            90
          )\d{6}
        </nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>939901234</exampleNumber>
        <nationalNumberPattern>
          9(?:
            399[0-3]|
            479[0-5]|
            76(?:
              2[27]|
              3[0-37]
            )
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Romania (RO) -->
    <!-- Extension prefix found online, confirmed by a Romanian. -->
    <!-- http://www.itu.int/oth/T02020000AC/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Romania -->
    <!-- http://www.ancom.org.ro/en/presentation-of-romanian-national-numbering-plan-according-to-itu-t-recommendation-e129-_5523 -->
    <territory id="RO" countryCode="40" internationalPrefix="00" nationalPrefix="0"
               preferredExtnPrefix=" int " mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2[3-6]</leadingDigits>
          <leadingDigits>2[3-6]\d9</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            219|
            31
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[23]1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- We format mobile numbers like this, even though ITU and wikipedia hint at
             \d{2}\d{3}\d{4} grouping, since the yellow pages (http://en.paginiaurii.ro/) and the
             majority of numbers found online follow this convention. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[236-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [236-8]\d|
            90
          )\d{7}|
          [23]\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- We exclude three-digit short numbers for Bucharest (219\d{2}) and four-digit short
           numbers outside Bucharest (2[36]\d9\d{3}) even though ITU suggests these exist. We do
           this based on numbers found online and the wikipedia article which indicate that these
           are four digits long in Bucharest only, and three digits elsewhere. -->
      <fixedLine>
        <possibleLengths national="6,9"/>
        <exampleNumber>211234567</exampleNumber>
        <nationalNumberPattern>
          [23][13-6]\d{7}|
          (?:
            2(?:
              19\d|
              [3-6]\d9
            )|
            31\d\d
          )\d\d
        </nationalNumberPattern>
      </fixedLine>
      <!-- http://www.enigma-system.net/business/customized-phone-number.html confirms that the
           numbers are restricted to those starting with 07000. Mobile prefix 0799 added based on
           open-source report and confirmation by existence of such numbers online.
           As per Ancom official doc, mobile numbers can also begin with 6. However, we didn't
           find any numbers online with this prefix, and the wikipedia source doesn't mention it,
           so we do not support it for now. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>712034567</exampleNumber>
        <nationalNumberPattern>
          7020\d{5}|
          (?:
            6(?:
              2\d|
              40
            )|
            7(?:
              0[013-9]|
              1[0-3]|
              [2-7]\d|
              8[03-8]|
              9[0-39]
            )
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>90[0136]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- 803\d{6} shared cost number pattern is not included as we couldn't find any working
           numbers online. -->
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>801123456</exampleNumber>
        <nationalNumberPattern>801\d{6}</nationalNumberPattern>
      </sharedCost>
      <!-- http://www.ancom.org.ro/pnn_1300 refers to numbers beginning with 37, 38 or 39 as
           location-independent national numbers. Only numbers beginning with 37 have been seen so
           these are the only ones supported for now. -->
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>372123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            37\d|
            80[578]
          )\d{6}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Serbia (RS) -->
    <!-- http://www.itu.int/oth/T02020000B9/en -->
    <!-- http://registar.ratel.rs/en/reg202 -->
    <territory id="RS" countryCode="381" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 3-digit prefix (fixed and mobile). -->
        <numberFormat pattern="(\d{3})(\d{3,9})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              2[389]|
              39
            )0|
            [7-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 2-digit prefix (fixed line and mobile). -->
        <numberFormat pattern="(\d{2})(\d{5,10})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-36]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          38[02-9]\d{6,9}|
          6\d{7,9}|
          90\d{4,8}|
          38\d{5,6}|
          (?:
            7\d\d|
            800
          )\d{3,9}|
          (?:
            [12]\d|
            3[0-79]
          )\d{5,10}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Most subscriber numbers may not start with 0 or 1. Exceptionally, the prefix 11 1[5-7]
           has been issused, so we allow 11 1X here. -->
      <fixedLine>
        <possibleLengths national="[7-12]" localOnly="[4-6]"/>
        <exampleNumber>10234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            11[1-9]\d|
            (?:
              2[389]|
              39
            )(?:
              0[2-9]|
              [2-9]\d
            )
          )\d{3,8}|
          (?:
            1[02-9]|
            2[0-24-7]|
            3[0-8]
          )[2-9]\d{4,9}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="[8-10]"/>
        <exampleNumber>601234567</exampleNumber>
        <nationalNumberPattern>
          6(?:
            [0-689]|
            7\d
          )\d{6,7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[6-12]"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>800\d{3,9}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="[6-10]"/>
        <exampleNumber>90012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            78\d|
            90[0169]
          )\d{3,7}
        </nationalNumberPattern>
      </premiumRate>
      <uan>
        <possibleLengths national="[6-12]"/>
        <exampleNumber>700123456</exampleNumber>
        <nationalNumberPattern>7[06]\d{4,10}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Russia (RU) -->
    <!-- Main region for 'KZ' -->
    <!-- http://www.itu.int/oth/T02020000AD/en -->
    <!-- http://en.wikipedia.org/wiki/%2B7 -->
    <!-- Formatting from wikipedia, confirmed on government websites such as
         http://www.minjust.ru/ru/structure/contact/. Contains formatting instructions for
         Kazakhstan as well. -->
    <territory id="RU" mainCountryForCode="true" countryCode="7" leadingDigits="3[04-689]|[489]"
               preferredInternationalPrefix="8~10" internationalPrefix="810" nationalPrefix="8"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})">
          <leadingDigits>[0-79]</leadingDigits>
          <format>$1-$2-$3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Kazakhstan formatting only. -->
        <numberFormat pattern="(\d{4})(\d{2})(\d{2})(\d{2})"
                      nationalPrefixFormattingRule="$NP ($FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            7(?:
              1[0-8]|
              2[1-9]
            )
          </leadingDigits>
          <leadingDigits>
            7(?:
              1(?:
                [0-356]2|
                4[29]|
                7|
                8[27]
              )|
              2(?:
                1[23]|
                [2-9]2
              )
            )
          </leadingDigits>
          <leadingDigits>
            7(?:
              1(?:
                [0-356]2|
                4[29]|
                7|
                8[27]
              )|
              2(?:
                13[03-69]|
                62[013-9]
              )
            )|
            72[1-57-9]2
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Kazakhstan formatting only. -->
        <numberFormat pattern="(\d{5})(\d)(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP ($FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            7(?:
              1[0-68]|
              2[1-9]
            )
          </leadingDigits>
          <leadingDigits>
            7(?:
              1(?:
                [06][3-6]|
                [18]|
                2[35]|
                [3-5][3-5]
              )|
              2(?:
                [13][3-5]|
                [24-689]|
                7[457]
              )
            )
          </leadingDigits>
          <leadingDigits>
            7(?:
              1(?:
                0(?:
                  [356]|
                  4[023]
                )|
                [18]|
                2(?:
                  3[013-9]|
                  5
                )|
                3[45]|
                43[013-79]|
                5(?:
                  3[1-8]|
                  4[1-7]|
                  5
                )|
                6(?:
                  3[0-35-9]|
                  [4-6]
                )
              )|
              2(?:
                1(?:
                  3[178]|
                  [45]
                )|
                [24-689]|
                3[35]|
                7[457]
              )
            )|
            7(?:
              14|
              23
            )4[0-8]|
            71(?:
              33|
              45
            )[1-79]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Kazakhstan formatting only. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP ($FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Russian number formatting mostly, some minor overlap with shared ranges. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{2})"
                      nationalPrefixFormattingRule="$NP ($FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            [349]|
            8(?:
              [02-7]|
              1[1-8]
            )
          </leadingDigits>
          <format>$1 $2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})(\d{3})(\d{3})"
                      nationalPrefixFormattingRule="$NP ($FG)">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          8\d{13}|
          [347-9]\d{9}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The Ivanovo area code 493 was omitted on the official document, but this is still used
           in the yellow pages, and on their own website and is listed on wikipedia. This applies
           also to 395 (Irkutsk). Also including the 840 prefix for Abkhazia. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>3011234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              0[12]|
              4[1-35-79]|
              5[1-3]|
              65|
              8[1-58]|
              9[0145]
            )|
            4(?:
              01|
              1[1356]|
              2[13467]|
              7[1-5]|
              8[1-7]|
              9[1-689]
            )|
            8(?:
              1[1-8]|
              2[01]|
              3[13-6]|
              4[0-8]|
              5[15]|
              6[1-35-79]|
              7[1-37-9]
            )
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>9123456789</exampleNumber>
        <nationalNumberPattern>9\d{9}</nationalNumberPattern>
      </mobile>
      <!-- The metadata states that 804 numbers are UAN numbers, but
           teleum.ru/numbers/toll_free_804 states that they are now being offered as toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="10,14"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          8(?:
            0[04]|
            108\d{3}
          )\d{7}
        </nationalNumberPattern>
      </tollFree>
      <!-- Covers tele-voting numbers as well. -->
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>8091234567</exampleNumber>
        <nationalNumberPattern>80[39]\d{7}</nationalNumberPattern>
      </premiumRate>
      <!-- These are referred to as UPT numbers in the plan. -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>8081234567</exampleNumber>
        <nationalNumberPattern>808\d{7}</nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Rwanda (RW) -->
    <!-- According to ITU, there is no national prefix. However, this is still used. As of June 3rd
         2011, this was confirmed by a Rwandan local. It is also shown in this format on pages such
         as http://www.tigo.co.rw "Choose Your Number" service. -->
    <!-- http://www.rura.gov.rw/docs/RWANDA_NATIONAL_NUMBERING_PLAN.pdf -->
    <!-- http://en.wikipedia.org/wiki/+250 -->
    <territory id="RW" countryCode="250" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[7-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            06|
            [27]\d\d|
            [89]00
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- We support satellite numbers here, since they are in the plan, although no recent
           online examples can be found. We also support fixed-line ranges that have been reserved
           and paid for, even where no online numbers can be found. -->
      <fixedLine>
        <possibleLengths national="8,9"/>
        <exampleNumber>250123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            06|
            2[23568]\d
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Removing 75 - that was Rwandatel but they had their license revoked. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>720123456</exampleNumber>
        <nationalNumberPattern>7[237-9]\d{7}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>900\d{6}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Saudi Arabia (SA) -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Saudi_Arabia -->
    <!-- http://www.itu.int/oth/T02020000B7/en -->
    <territory id="SA" countryCode="966" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- It seems that the trunk prefix is not used for these numbers, based on wikipedia and on
             the fact that no numbers of this form found online have a trunk prefix added. -->
        <numberFormat pattern="(\d{4})(\d{5})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>5</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>81</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          92\d{7}|
          (?:
            [15]|
            8\d
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>112345678</exampleNumber>
        <nationalNumberPattern>
          1(?:
            1\d|
            2[24-8]|
            3[35-8]|
            4[3-68]|
            6[2-5]|
            7[235-7]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>512345678</exampleNumber>
        <nationalNumberPattern>
          579[01]\d{5}|
          5(?:
            [013-689]\d|
            7[0-8]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
      </tollFree>
      <!-- Contains shared revenue range 925, as calling these numbers involve charges from carrier
           and the organization that you are calling. -->
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>925012345</exampleNumber>
        <nationalNumberPattern>925\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>920012345</exampleNumber>
        <nationalNumberPattern>920\d{6}</nationalNumberPattern>
      </sharedCost>
      <!-- Including "Nomadic" numbers from the Telecom Company "Go". "Go" says these are fixed-line
           that can be moved with no further setup. As these are mobile in nature and UAN is the
           closest match, adding it here. -->
      <uan>
        <possibleLengths national="10"/>
        <exampleNumber>8110123456</exampleNumber>
        <nationalNumberPattern>811\d{7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Solomon Islands (SB) -->
    <!-- http://www.itu.int/oth/T02020000BF/en -->
    <!-- A single group is used to format 5-digit numbers. This formatting pattern follows
         the guidelines in the ITU document. -->
    <territory id="SB" countryCode="677" internationalPrefix="0[01]">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{5})">
          <leadingDigits>
            7|
            8[4-9]|
            9(?:
              [1-8]|
              9[0-8]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [1-6]|
            [7-9]\d\d
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Although not mentioned in the 2011 update, it seems likely that the range 67300-67699
           is still used for Sasamunga, Shortland, Poitete and Ringgi as per the 2010 plan. -->
      <fixedLine>
        <possibleLengths national="5"/>
        <exampleNumber>40123</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[4-79]|
            [23]\d|
            4[0-2]|
            5[03]|
            6[0-37]
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="5,7"/>
        <exampleNumber>7421234</exampleNumber>
        <nationalNumberPattern>
          48\d{3}|
          (?:
            (?:
              7[1-9]|
              8[4-9]
            )\d|
            9(?:
              1[2-9]|
              2[013-9]|
              3[0-2]|
              [46]\d|
              5[0-46-9]|
              7[0-689]|
              8[0-79]|
              9[0-8]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="5"/>
        <exampleNumber>18123</exampleNumber>
        <nationalNumberPattern>1[38]\d{3}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="5"/>
        <exampleNumber>51123</exampleNumber>
        <nationalNumberPattern>5[12]\d{3}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Seychelles (SC) -->
    <!-- http://www.itu.int/oth/T02020000BA/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Seychelles -->
    <territory id="SC" countryCode="248" preferredInternationalPrefix="00"
               internationalPrefix="010|0[0-2]">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{3})">
          <leadingDigits>
            [246]|
            9[57]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          800\d{4}|
          (?:
            [249]\d|
            64
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- We are putting Fixed Services numbers here for now, as we cannot find any evidence that
           they are more expensive to call than other Fixed Line services. ISDN and DID services
           are here too, since they seem to be also fixed-line phone numbers. -->
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>4217123</exampleNumber>
        <nationalNumberPattern>4[2-46]\d{5}</nationalNumberPattern>
      </fixedLine>
      <!-- Includes Fixed Cellular. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>2510123</exampleNumber>
        <nationalNumberPattern>2[125-8]\d{5}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>8000000</exampleNumber>
        <nationalNumberPattern>800[08]\d{3}</nationalNumberPattern>
      </tollFree>
      <!-- Includes prefix 971,95[0-9] which is assigned to Audiotext ,International Audiotext
           Services. -->
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>6412345</exampleNumber>
        <nationalNumberPattern>
          971\d{4}|
          (?:
            64|
            95
          )\d{5}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Sudan (SD) -->
    <!-- http://www.itu.int/oth/T02020000C4/en -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Sudan -->
    <territory id="SD" countryCode="249" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[19]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[19]\d{8}</nationalNumberPattern>
      </generalDesc>
      <!-- Retaining previous prefix as 18 since it seems still to be used. ITU doc says 12 is a
           fixed-line range but we are supporting 1[0-2] under mobile as Sudatel mentions that
           these mobile ranges are assigned to them. -->
      <!-- The third digit here is an area code as per Wikipedia. Added 154 range based on valid
           numbers found online. -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>153123456</exampleNumber>
        <nationalNumberPattern>
          1(?:
            5\d|
            8[35-7]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>911231234</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[0-2]|
            9[0-3569]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Sweden (SE) -->
    <!-- https://www.pts.se/en/english-b/telephony/national-numbering-and-addressing-plans/ -->
    <!-- Formatting patterns are from the numbering plan and from the Swedish yellow pages
         http://gulasidorna.eniro.se -->
    <territory id="SE" countryCode="46" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Short toll-free numbers. -->
        <numberFormat pattern="(\d{2})(\d{2,3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>20</leadingDigits>
          <format>$1-$2 $3</format>
          <intlFormat>$1 $2 $3</intlFormat>
        </numberFormat>
        <!-- 7 digit premium rate numbers. -->
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            9(?:
              00|
              39|
              44|
              9
            )
          </leadingDigits>
          <format>$1-$2</format>
          <intlFormat>$1 $2</intlFormat>
        </numberFormat>
        <!-- Short fixed line numbers (2 digit area code) -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [12][136]|
            3[356]|
            4[0246]|
            6[03]|
            90[1-9]
          </leadingDigits>
          <format>$1-$2 $3</format>
          <intlFormat>$1 $2 $3</intlFormat>
        </numberFormat>
        <!-- Fixed line numbers in Stockholm (1 digit area code) -->
        <numberFormat pattern="(\d)(\d{2,3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1-$2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <!-- Short fixed line numbers (3 digit area code) -->
        <numberFormat pattern="(\d{3})(\d{2,3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1[2457]|
            2(?:
              [247-9]|
              5[0138]
            )|
            3[0247-9]|
            4[1357-9]|
            5[0-35-9]|
            6(?:
              [125689]|
              4[02-57]|
              7[0-2]
            )|
            9(?:
              [125-8]|
              3[02-5]|
              4[0-3]
            )
          </leadingDigits>
          <format>$1-$2 $3</format>
          <intlFormat>$1 $2 $3</intlFormat>
        </numberFormat>
        <!-- 8-9 digit premium rate numbers. -->
        <numberFormat pattern="(\d{3})(\d{2,3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            9(?:
              00|
              39|
              44
            )
          </leadingDigits>
          <format>$1-$2 $3</format>
          <intlFormat>$1 $2 $3</intlFormat>
        </numberFormat>
        <!-- Fixed line numbers (2 digit area code) and "long" toll free numbers. -->
        <numberFormat pattern="(\d{2})(\d{2,3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1[13689]|
            2[0136]|
            3[1356]|
            4[0246]|
            54|
            6[03]|
            90[1-9]
          </leadingDigits>
          <format>$1-$2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <!-- Mobile numbers and other 9 digit numbers starting with 7 (pager, shared cost etc.)
             Also for UAN numbers starting with 10. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            10|
            7
          </leadingDigits>
          <format>$1-$2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <!-- Fixed line numbers in Stockholm (1 digit area code) -->
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1-$2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <!-- Fixed line numbers (3 digit area code) -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [13-5]|
            2(?:
              [247-9]|
              5[0138]
            )|
            6(?:
              [124-689]|
              7[0-2]
            )|
            9(?:
              [125-8]|
              3[02-5]|
              4[0-3]
            )
          </leadingDigits>
          <format>$1-$2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <!-- 10 digit premium rate numbers. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1-$2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <!-- Voicemail -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{3})(\d{2})(\d{2})"
                      nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[26]</leadingDigits>
          <format>$1-$2 $3 $4 $5</format>
          <intlFormat>$1 $2 $3 $4 $5</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [26]\d\d|
            9
          )\d{9}|
          [1-9]\d{8}|
          [1-689]\d{7}|
          [1-4689]\d{6}|
          2\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="[7-9]"/>
        <exampleNumber>8123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              [12][136]|
              3[356]|
              4[0246]|
              6[03]|
              8\d
            )\d|
            90[1-9]
          )\d{4,6}|
          (?:
            1(?:
              2[0-35]|
              4[0-4]|
              5[0-25-9]|
              7[13-6]|
              [89]\d
            )|
            2(?:
              2[0-7]|
              4[0136-8]|
              5[0138]|
              7[018]|
              8[01]|
              9[0-57]
            )|
            3(?:
              0[0-4]|
              1\d|
              2[0-25]|
              4[056]|
              7[0-2]|
              8[0-3]|
              9[023]
            )|
            4(?:
              1[013-8]|
              3[0135]|
              5[14-79]|
              7[0-246-9]|
              8[0156]|
              9[0-689]
            )|
            5(?:
              0[0-6]|
              [15][0-5]|
              2[0-68]|
              3[0-4]|
              4\d|
              6[03-5]|
              7[013]|
              8[0-79]|
              9[01]
            )|
            6(?:
              1[1-3]|
              2[0-4]|
              4[02-57]|
              5[0-37]|
              6[0-3]|
              7[0-2]|
              8[0247]|
              9[0-356]
            )|
            9(?:
              1[0-68]|
              2\d|
              3[02-5]|
              4[0-3]|
              5[0-4]|
              [68][01]|
              7[0135-8]
            )
          )\d{5,6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>701234567</exampleNumber>
        <nationalNumberPattern>7[02369]\d{7}</nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="9"/>
        <exampleNumber>740123456</exampleNumber>
        <nationalNumberPattern>74[02-9]\d{6}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="[6-9]"/>
        <exampleNumber>20123456</exampleNumber>
        <nationalNumberPattern>20\d{4,7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="[7-10]"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>
          649\d{6}|
          99[1-59]\d{4}(?:
            \d{3}
          )?|
          9(?:
            00|
            39|
            44
          )[1-8]\d{3,6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>771234567</exampleNumber>
        <nationalNumberPattern>77[0-7]\d{6}</nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>751234567</exampleNumber>
        <nationalNumberPattern>75[1-8]\d{6}</nationalNumberPattern>
      </personalNumber>
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>102345678</exampleNumber>
        <nationalNumberPattern>10[1-8]\d{6}</nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="12"/>
        <exampleNumber>254123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            25[245]|
            67[3-68]
          )\d{9}
        </nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Singapore (SG) -->
    <!-- http://www.ida.gov.sg/Policies-and-Regulations/Industry-and-Licensees/Numbering/National-Numbering-Plan-and-Allocation-Process.aspx -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore -->
    <territory id="SG" countryCode="65" internationalPrefix="0[0-3]\d"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{4,5})">
          <leadingDigits>
            1[013-9]|
            77
          </leadingDigits>
          <leadingDigits>
            1(?:
              [013-8]|
              9(?:
                0[1-9]|
                [1-9]
              )
            )|
            77
          </leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>
            [369]|
            8(?:
              0[1-9]|
              [1-9]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})(\d{3})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            (?:
              1\d|
              8
            )\d\d|
            7000
          )\d{7}|
          [3689]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>61234567</exampleNumber>
        <nationalNumberPattern>
          662[0-24-9]\d{4}|
          6(?:
            [0-578]\d|
            6[013-57-9]|
            9[0-35-9]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 802[23] ,804[1467] and 8055 are added based on user report.  -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>81234567</exampleNumber>
        <nationalNumberPattern>
          8(?:
            09|
            95
          )[0-2]\d{4}|
          (?:
            8(?:
              0[1-8]|
              [1-8]\d|
              9[0-4]
            )|
            9[0-8]\d
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10,11"/>
        <exampleNumber>18001234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            18|
            8
          )00\d{7}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="11"/>
        <exampleNumber>19001234567</exampleNumber>
        <nationalNumberPattern>1900\d{7}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>31234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[12]\d|
            666
          )\d{5}
        </nationalNumberPattern>
      </voip>
      <!-- Although not detailed in the plan beyond mentioning their existence, it seems 7000
           numbers are used for companies. Most of the online examples are in fact alpha-numbers. -->
      <uan>
        <possibleLengths national="11"/>
        <exampleNumber>70001234567</exampleNumber>
        <nationalNumberPattern>7000\d{7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- St. Helena (SH) -->
    <!-- Main region for 'TA' -->
    <!-- http://www.itu.int/oth/T02020000AF/en -->
    <territory id="SH" mainCountryForCode="true" countryCode="290" leadingDigits="[256]"
               internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [256]\d|
            8
          )\d{3}
        </nationalNumberPattern>
      </generalDesc>
      <!-- There is a bug in the way the library calculates whether numbers are "possible" for a
           region in that it uses the "main" country if multiple countries share a country calling
           code. Trista da Cuñha shares a country calling code with Saint Helena but has only 4
           digit numbers, so we include 4 as a possible length here. -->
      <!-- St Helena has changed to 5 digits on October 1. 2013 -->
      <!-- Using St Helena Tourism as the example number. -->
      <fixedLine>
        <possibleLengths national="4,5"/>
        <exampleNumber>22158</exampleNumber>
        <nationalNumberPattern>
          2(?:
            [0-57-9]\d|
            6[4-9]
          )\d\d
        </nationalNumberPattern>
      </fixedLine>
      <!-- Effective 1st August 2015 -->
      <mobile>
        <possibleLengths national="5"/>
        <exampleNumber>51234</exampleNumber>
        <nationalNumberPattern>[56]\d{4}</nationalNumberPattern>
      </mobile>
      <!-- The ITU doc reserves prefixes 260 and 261 for Information Service and prefix 263 for
           Flexible access. We do not support these prefixes as we do not have any information
           about their usage. -->
      <voip>
        <possibleLengths national="5"/>
        <exampleNumber>26212</exampleNumber>
        <nationalNumberPattern>262\d\d</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Slovenia (SI) -->
    <!-- http://www.itu.int/oth/T02020000BE/en -->
    <!-- http://www.akos-rs.si/numbering-space -->
    <territory id="SI" countryCode="386" preferredInternationalPrefix="00"
               internationalPrefix="00|10(?:22|66|88|99)" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3,6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            8[09]|
            9
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            59|
            8
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [37][01]|
            4[0139]|
            51|
            6
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>[1-57]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-7]\d{7}|
          8\d{4,7}|
          90\d{4,6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Prefix 32 added after a user report. -->
      <fixedLine>
        <possibleLengths national="8" localOnly="7"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            [1-357][2-8]|
            4[24-8]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 43 range is mentioned as geographic number in 18.VII.2018 ITU doc where as previous
           ITU doc (15.III.2017) says it is MVNO. Supporting it under mobile as we found the
           numbers does not belong to same area. We include 049 here - it is VoIP in the plan,
           but is actually used to provide mobile coverage to Kosovo. Supporting all 69X numbers
           based on Wikipedia and some sub ranges being present in IR 21 doc. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>31234567</exampleNumber>
        <nationalNumberPattern>
          65(?:
            [178]\d|
            5[56]|
            6[01]
          )\d{4}|
          (?:
            [37][01]|
            4[0139]|
            51|
            6[489]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[6-8]"/>
        <exampleNumber>80123456</exampleNumber>
        <nationalNumberPattern>80\d{4,6}</nationalNumberPattern>
      </tollFree>
      <!-- Includes televoting, mass calling -->
      <premiumRate>
        <possibleLengths national="[5-8]"/>
        <exampleNumber>90123456</exampleNumber>
        <nationalNumberPattern>
          89[1-3]\d{2,5}|
          90\d{4,6}
        </nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>59012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            59\d\d|
            8(?:
              1(?:
                [67]\d|
                8[0-589]
              )|
              2(?:
                0\d|
                2[0-37-9]|
                8[0-2489]
              )|
              3[389]\d
            )
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Svalbard & Jan Mayen (SJ) -->
    <!-- Calling code and formatting shared with 'NO' -->
    <!-- http://www.npt.no/pt_internet/numsys/E.164.pdf -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Svalbard -->
    <territory id="SJ" countryCode="47" leadingDigits="79" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>
          0\d{4}|
          (?:
            [489]\d|
            79
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>79123456</exampleNumber>
        <nationalNumberPattern>79\d{6}</nationalNumberPattern>
      </fixedLine>
      <!-- Copied from Norway metadata. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>41234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            4[015-8]|
            9\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80012345</exampleNumber>
        <nationalNumberPattern>80[01]\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>82012345</exampleNumber>
        <nationalNumberPattern>82[09]\d{5}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>81021234</exampleNumber>
        <nationalNumberPattern>
          810(?:
            0[0-6]|
            [2-8]\d
          )\d{3}
        </nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="8"/>
        <exampleNumber>88012345</exampleNumber>
        <nationalNumberPattern>880\d{5}</nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>85012345</exampleNumber>
        <nationalNumberPattern>85[0-5]\d{5}</nationalNumberPattern>
      </voip>
      <!-- Includes some 810 local-rate numbers, and long-distance rate numbers. -->
      <uan>
        <possibleLengths national="5,8"/>
        <exampleNumber>02000</exampleNumber>
        <nationalNumberPattern>
          (?:
            0[2-9]|
            81(?:
              0(?:
                0[7-9]|
                1\d
              )|
              5\d\d
            )
          )\d{3}
        </nationalNumberPattern>
      </uan>
      <voicemail>
        <possibleLengths national="8"/>
        <exampleNumber>81212345</exampleNumber>
        <nationalNumberPattern>81[23]\d{5}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Slovakia (SK) -->
    <!-- http://www.itu.int/oth/T02020000BD/en -->
    <!-- http://www.teleoff.gov.sk/data/files/25211.pdf -->
    <territory id="SK" countryCode="421" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{2})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>21</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[3-5][1-8]1</leadingDigits>
          <leadingDigits>[3-5][1-8]1[67]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>909</leadingDigits>
          <leadingDigits>9090</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[689]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[3-5]</leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [2-689]\d{8}|
          [2-59]\d{6}|
          [2-5]\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="7,9"/>
        <nationalNumberPattern>
          9090\d{3}|
          (?:
            602|
            8(?:
              00|
              [5-9]\d
            )|
            9(?:
              00|
              [78]\d
            )
          )\d{6}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- Added range 16 as per pattern [areacode] + 16 + SN(\d{2,4}) -->
      <fixedLine>
        <possibleLengths national="6,7,9"/>
        <exampleNumber>221234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              16|
              [2-9]\d{3}
            )|
            (?:
              (?:
                [3-5][1-8]\d|
                819
              )\d|
              601[1-5]
            )\d
          )\d{4}|
          (?:
            2|
            [3-5][1-8]
          )1[67]\d{3}|
          [3-5][1-8]16\d\d
        </nationalNumberPattern>
      </fixedLine>
      <!-- 948 isn't in the number pattern, but many examples using this have been found, so
           deeming it valid for now. 909[1-9] is assigned to carrier Juro as per online
           references found. 945 is assigned to Orange as per its carrier doc. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912123456</exampleNumber>
        <nationalNumberPattern>
          909[1-9]\d{5}|
          9(?:
            0[1-8]|
            1[0-24-9]|
            4[03-57-9]|
            5\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <pager>
        <possibleLengths national="7"/>
        <exampleNumber>9090123</exampleNumber>
        <nationalNumberPattern>9090\d{3}</nationalNumberPattern>
      </pager>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>
          9(?:
            00|
            [78]\d
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>850123456</exampleNumber>
        <nationalNumberPattern>8[5-9]\d{7}</nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>690123456</exampleNumber>
        <nationalNumberPattern>
          6(?:
            02|
            5[0-4]|
            9[0-6]
          )\d{6}
        </nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>961234567</exampleNumber>
        <nationalNumberPattern>96\d{7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Sierra Leone (SL) -->
    <!-- http://www.itu.int/oth/T02020000BB/en -->
    <territory id="SL" countryCode="232" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- Following formatting of online yellow pages http://www.leonedirect.com -->
        <numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>[236-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [237-9]\d|
            66
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8" localOnly="6"/>
        <exampleNumber>22221234</exampleNumber>
        <nationalNumberPattern>22[2-4][2-9]\d{4}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>25123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            25|
            3[0-5]|
            66|
            7[2-9]|
            8[08]|
            9[09]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- San Marino (SM) -->
    <!-- San Marino fixed-line numbers have an area code of "0549". However, this seems to be
         optional when dialling from outside the country; the phone number can be reached both with
         and without this area code. The nationalPrefixForParsing and nationalPrefixTransformRule
         are used to ensure that if the 0549 is not present, it will be added. -->
    <!-- Information about Italy. -->
    <!-- http://www.itu.int/oth/T02020000B5/en -->
    <!-- http://en.wikipedia.org/wiki/%2B39 -->
    <!-- http://en.wikipedia.org/wiki/%2B378 -->
    <territory id="SM" countryCode="378" internationalPrefix="00"
               nationalPrefixForParsing="([89]\d{5})$" nationalPrefixTransformRule="0549$1">
      <availableFormats>
        <numberFormat pattern="(\d{6})">
          <leadingDigits>[89]</leadingDigits>
          <format>$1</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Non-geographic numbers (without 0549 prefix). -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[5-7]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- We follow the guidelines of the yellow-pages when formatting in national format. -->
        <numberFormat pattern="(\d{4})(\d{6})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            0549|
            [5-7]\d
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Example numbers provided by the Telecommunications Services. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="6"/>
        <exampleNumber>0549886377</exampleNumber>
        <nationalNumberPattern>
          0549(?:
            8[0157-9]|
            9\d
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>66661212</exampleNumber>
        <nationalNumberPattern>6[16]\d{6}</nationalNumberPattern>
      </mobile>
      <!-- Includes Video Call numbers. -->
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>71123456</exampleNumber>
        <nationalNumberPattern>7[178]\d{6}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>58001110</exampleNumber>
        <nationalNumberPattern>5[158]\d{6}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Senegal (SN) -->
    <!-- http://www.itu.int/oth/T02020000B8/en -->
    <!-- http://www.artpsenegal.net/index.php?option=com_content&view=article&id=50 -->
    <territory id="SN" countryCode="221" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Using yellow pages and online telecom company formatting, rather than that implied in
             the national numbering plan. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})">
          <leadingDigits>[379]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [378]\d|
            93
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>301012345</exampleNumber>
        <nationalNumberPattern>
          3(?:
            0(?:
              1[0-2]|
              80
            )|
            282|
            3(?:
              8[1-9]|
              9[3-9]
            )|
            611
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>701234567</exampleNumber>
        <nationalNumberPattern>
          7(?:
            (?:
              [06-8]\d|
              21|
              90
            )\d|
            5(?:
              01|
              [19]0|
              25|
              [38]3|
              [4-7]\d
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <!-- Revenu Partagé in the plan. -->
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>884123456</exampleNumber>
        <nationalNumberPattern>88[4689]\d{6}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>810123456</exampleNumber>
        <nationalNumberPattern>81[02468]\d{6}</nationalNumberPattern>
      </sharedCost>
      <!-- Also covers satellite telephony ranges. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>933301234</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              392|
              9[01]\d
            )\d|
            93(?:
              3[13]0|
              929
            )
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Somalia (SO) -->
    <!-- This document seems to cover only a small set of prefixes in Somalia. Somalia has limited
         information available, and the numerous telecom carriers were previously working under an
         unregulated environment. The extra prefixes were added from the contact phone numbers of
         the countries main telecom operators. We also have received information that a national
         prefix of "0" is required when dialling from different regions (e.g. Puntland, Somaliland)
         for some operators, so that is included here although we do not use it when formatting. -->
    <!-- http://www.itu.int/oth/T02020000C0/en -->
    <!-- http://en.wikipedia.org/wiki/+252 -->
    <territory id="SO" countryCode="252" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})">
          <leadingDigits>8[125]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{6})">
          <leadingDigits>[134]</leadingDigits>
          <format>$1</format>
        </numberFormat>
        <!-- These follow formats online,  such as http://www.hortel.net/contact_us.html -->
        <numberFormat pattern="(\d)(\d{6})">
          <leadingDigits>
            [15]|
            2[0-79]|
            3[0-46-8]|
            4[0-7]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{7})">
          <leadingDigits>
            (?:
              2|
              90
            )4|
            [67]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>
            [348]|
            64|
            79|
            90
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{5,7})">
          <leadingDigits>
            1|
            28|
            6[0-35-9]|
            77|
            9[2-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [346-9]\d{8}|
          [12679]\d{7}|
          [1-5]\d{6}|
          [1348]\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Apparently Telesom and Nationlink (Somaliland) both use the prefix 2. We exclude 28
           here since that is apparently used for mobile. As per ITU doc 6 digit mobile numbers
           are possible for 1, 3, 4, 81, 82 and 85 prefixes. -->
      <fixedLine>
        <possibleLengths national="6,7"/>
        <exampleNumber>4012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            1\d|
            2[0-79]|
            3[0-46-8]|
            4[0-7]|
            5[57-9]
          )\d{5}|
          (?:
            [134]\d|
            8[125]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- 24 is used by the carrier Telesom. 28 is used by Nationlink. 6[89] are apparently used
           by Nationlink Somalia, 67 by Nationlink Puntland, and 61 by Hormuud. 7X is used by
           Somtel. 6 followed by only 7 digits is used by Telecom. Note that in June 2014 many
           ranges were suspended by the government. 90\d{6} was listed as one of the ranges to be
           suspended, but open-source contributors confirm that 90[67]\d{6} is still in use, even
           if the shorter 90 ranges are no longer. -->
      <mobile>
        <possibleLengths national="[7-9]"/>
        <exampleNumber>71123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              15|
              (?:
                3[59]|
                4[89]|
                6\d|
                7[79]|
                8[08]
              )\d|
              9(?:
                0\d|
                [2-9]
              )
            )\d|
            2(?:
              4\d|
              8
            )
          )\d{5}|
          (?:
            [67]\d\d|
            904
          )\d{5}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Suriname (SR) -->
    <!-- http://www.itu.int/oth/T02020000C5/en -->
    <territory id="SR" countryCode="597" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})">
          <leadingDigits>56</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <!-- Following conventions used in the Suriname Yellow Pages. -->
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>[2-5]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[6-8]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-5]|
            68|
            [78]\d
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Includes non-geographic WLL-CDMA Fixed Lines. -->
      <fixedLine>
        <possibleLengths national="6,7"/>
        <exampleNumber>211234</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[1-3]|
            3[0-7]|
            (?:
              4|
              68
            )\d|
            5[2-58]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>7412345</exampleNumber>
        <nationalNumberPattern>
          (?:
            7[124-7]|
            8[124-9]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <voip>
        <possibleLengths national="6"/>
        <exampleNumber>561234</exampleNumber>
        <nationalNumberPattern>56\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- South Sudan (SS) -->
    <!-- http://www.itu.int/oth/T02020000F9/en -->
    <!-- http://en.wikipedia.org/wiki/+211 -->
    <territory id="SS" countryCode="211" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[19]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[19]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>181234567</exampleNumber>
        <nationalNumberPattern>1[89]\d{7}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>977123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            12|
            9[1257-9]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- São Tomé & Príncipe (ST) -->
    <!-- http://www.itu.int/oth/T02020000B6/en -->
    <territory id="ST" countryCode="239" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[29]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            22|
            9\d
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2221234</exampleNumber>
        <nationalNumberPattern>22\d{5}</nationalNumberPattern>
      </fixedLine>
      <!-- Added prefix 90 per IR21 from the carrier -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>9812345</exampleNumber>
        <nationalNumberPattern>
          900[5-9]\d{3}|
          9(?:
            0[1-9]|
            [89]\d
          )\d{4}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- El Salvador (SV) -->
    <!-- http://www.itu.int/oth/T020200003F/en -->
    <!-- http://www.siget.gob.sv/BusquedaPublica.aspx?pagina=3&tipo=27&titulo=t8&sector=2&ordenar=&dir=DESC -->
    <territory id="SV" countryCode="503" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[267]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})(\d{4})">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [267]\d{7}|
          (?:
            80\d|
            900
          )\d{4}(?:
            \d{4}
          )?
        </nationalNumberPattern>
      </generalDesc>
      <!-- Numbers starting with 20, 27, 28 and 29 are reserved but not yet used. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>
          2(?:
            79(?:
              0[0347-9]|
              [1-9]\d
            )|
            89(?:
              0[024589]|
              [1-9]\d
            )
          )\d{3}|
          2(?:
            [1-69]\d|
            [78][0-8]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>70123456</exampleNumber>
        <nationalNumberPattern>[67]\d{7}</nationalNumberPattern>
      </mobile>
      <!-- Toll free numbers are either 800 NNNN or 800 NNNN NNNN. -->
      <tollFree>
        <possibleLengths national="7,11"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>
          800\d{8}|
          80[01]\d{4}
        </nationalNumberPattern>
      </tollFree>
      <!-- Premium rate numbers are either 900 NNNN or 900 NNNN NNNN. -->
      <premiumRate>
        <possibleLengths national="7,11"/>
        <exampleNumber>9001234</exampleNumber>
        <nationalNumberPattern>
          900\d{4}(?:
            \d{4}
          )?
        </nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Sint Maarten (SX) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.nanpa.com/pdf/PL_429.pdf -->
    <!-- http://www.itu.int/oth/T02020000F7/en -->
    <territory id="SX" countryCode="1" leadingDigits="721" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="(5\d{6})$|1"
               nationalPrefixTransformRule="721$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          7215\d{6}|
          (?:
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7215425678</exampleNumber>
        <nationalNumberPattern>
          7215(?:
            4[2-8]|
            8[239]|
            9[056]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- We assume we can send SMSs to the Fixed GSM numbers mentioned in the plan and hence
           include these as mobile numbers. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7215205678</exampleNumber>
        <nationalNumberPattern>
          7215(?:
            1[02]|
            2\d|
            5[034679]|
            8[014-8]
          )\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>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Syria (SY) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T02020000C9/en -->
    <!-- http://en.wikipedia.org/wiki/%2B963 -->
    <territory id="SY" countryCode="963" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[1-5]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-39]\d{8}|
          [1-5]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Numbers with the 21 prefix are made optionally 1-digit longer based on numbers found on
           the Internet. -->
      <fixedLine>
        <possibleLengths national="8,9" localOnly="6,7"/>
        <exampleNumber>112345678</exampleNumber>
        <nationalNumberPattern>
          21\d{6,7}|
          (?:
            1(?:
              [14]\d|
              [2356]
            )|
            2[235]|
            3(?:
              [13]\d|
              4
            )|
            4[134]|
            5[1-3]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Numbers have been found online for the prefixes 922, 95[138], and 96[05]. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>944567890</exampleNumber>
        <nationalNumberPattern>9[1-689]\d{7}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Eswatini (SZ) -->
    <!-- http://www.itu.int/oth/T02020000C6/en -->
    <territory id="SZ" countryCode="268" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[0237]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{5})(\d{4})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          0800\d{4}|
          (?:
            [237]\d|
            900
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="8"/>
        <nationalNumberPattern>0800\d{4}</nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22171234</exampleNumber>
        <nationalNumberPattern>[23][2-5]\d{6}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>76123456</exampleNumber>
        <nationalNumberPattern>7[6-9]\d{6}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>08001234</exampleNumber>
        <nationalNumberPattern>0800\d{4}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900012345</exampleNumber>
        <nationalNumberPattern>900\d{6}</nationalNumberPattern>
      </premiumRate>
      <voip>
        <possibleLengths national="8"/>
        <exampleNumber>70012345</exampleNumber>
        <nationalNumberPattern>70\d{6}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Tristan da Cunha (TA) -->
    <!-- Calling code and formatting shared with 'SH' -->
    <!-- http://www.itu.int/oth/T02020000AF/en -->
    <territory id="TA" countryCode="290" leadingDigits="8" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>8\d{3}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="4"/>
        <exampleNumber>8999</exampleNumber>
        <nationalNumberPattern>8\d{3}</nationalNumberPattern>
      </fixedLine>
    </territory>

    <!-- Turks & Caicos Islands (TC) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000D8/en -->
    <territory id="TC" countryCode="1" leadingDigits="649" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-479]\d{6})$|1"
               nationalPrefixTransformRule="649$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            649|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6497121234</exampleNumber>
        <nationalNumberPattern>
          649(?:
            266|
            712|
            9(?:
              4\d|
              50
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Extra prefixes 246, 247, 346 found online and in the yellow pages. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6492311234</exampleNumber>
        <nationalNumberPattern>
          649(?:
            2(?:
              3[129]|
              4[1-79]
            )|
            3\d\d|
            4[34][1-3]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>6497101234</exampleNumber>
        <nationalNumberPattern>
          649(?:
            71[01]|
            966
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Chad (TD) -->
    <!-- The international prefix includes 16 as the international manual exchange. -->
    <!-- http://www.itu.int/oth/T0202000029/en -->
    <territory id="TD" countryCode="235" preferredInternationalPrefix="00"
               internationalPrefix="00|16">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[2679]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            22|
            [69]\d|
            77
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22501234</exampleNumber>
        <nationalNumberPattern>
          22(?:
            [37-9]0|
            5[0-5]|
            6[89]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Sotel Tchad "SALAM" (77 XX XX XX) is classified as a fixed operator in the plan, but it
           also says numbers starting with 7 are mobile numbers. Putting under mobile for now.
           Also adding 6[028] and 63[5-9] which are operated by Airtel. -->
      <!-- Adding entire 9 prefix based on information from carrier. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>63012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            6[0235689]|
            77|
            9\d
          )\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Togo (TG) -->
    <!-- http://www.itu.int/oth/T02020000D1/en -->
    <territory id="TG" countryCode="228" internationalPrefix="00">
      <availableFormats>
        <!-- Added leading digits so that the shortcodes do not pick this format during AYTF. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[279]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[279]\d{7}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>22212345</exampleNumber>
        <nationalNumberPattern>
          2(?:
            2[2-7]|
            3[23]|
            4[45]|
            55|
            6[67]|
            77
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>90112345</exampleNumber>
        <nationalNumberPattern>
          (?:
            7[019]|
            9[0-36-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Thailand (TH) -->
    <!-- Subscribers can use respective carrier's IDD when calling abroad. We have not configured
         any preferredInternationalPrefix as there is no official evidence for it. -->
    <!-- http://www.itu.int/oth/T02020000CD/en -->
    <!-- http://www.barascientific.com/bscnews/variety/emergency/Tel-4Digi.pdf -->
    <!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Thailand -->
    <territory id="TH" countryCode="66" internationalPrefix="00[1-9]" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Formatting patterns from wikipedia and the document itself -
             http://en.wikipedia.org/wiki/%2B66 -->
        <numberFormat pattern="(\d)(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[13-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            001800|
            [2-57]|
            [689]\d
          )\d{7}|
          1\d{7,9}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Numbers online have been found that start with 20, despite the ITU doc not covering
           these. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>21234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            1[0689]|
            2\d|
            3[2-9]|
            4[2-5]|
            5[2-6]|
            7[3-7]
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Numbers found online starting with 62 and 64. 14, 63 and 65 are from an open-source bug
           report, we couldn't find evidence of these specifically being in use but this article
           http://www.prachachat.net/news_detail.php?newsid=1395732787 talks about prefix 6 and 1
           being cleared for mobile use. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>812345678</exampleNumber>
        <nationalNumberPattern>
          67(?:
            1[0-8]|
            2[4-7]
          )\d{5}|
          (?:
            14|
            6[1-6]|
            [89]\d
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- http://en.wikipedia.org/wiki/Toll-free_telephone_number. Prefix 001800 of length
           13-digit is added based on user report. -->
      <tollFree>
        <possibleLengths national="10,13"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            001800\d|
            1800
          )\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>1900123456</exampleNumber>
        <nationalNumberPattern>1900\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- The ITU document says that the 89 prefix is also VOIP but there are lots of numbers
           online to suggest they are actually used as mobile numbers. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>601234567</exampleNumber>
        <nationalNumberPattern>6[08]\d{7}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Tajikistan (TJ) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T02020000CA/en -->
    <!-- Based on details from vendors and online investigation results, 8 is no more considered
         as national dialling code. Originally added based on Wikipedia. It cannot coexits when
         810 is considered as international exit code and 10 as one of mobile ranges. -->
    <territory id="TJ" countryCode="992" preferredInternationalPrefix="8~10"
               internationalPrefix="810">
      <availableFormats>
        <numberFormat pattern="(\d{6})(\d)(\d{2})">
          <leadingDigits>331</leadingDigits>
          <leadingDigits>3317</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})">
          <leadingDigits>
            44[02-479]|
            [34]7
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d)(\d{4})">
          <leadingDigits>3[1-5]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>[0-57-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[0-57-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9" localOnly="3,[5-7]"/>
        <exampleNumber>372123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            3(?:
              1[3-5]|
              2[245]|
              3[12]|
              4[24-7]|
              5[25]|
              72
            )|
            4(?:
              46|
              74|
              87
            )
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 90 prefix as SMS messages could be successfully delivered to these mobile
           numbers and 55 for Megafon from bug reports. 00 mobile range is assigned to
           Megafon as per their confirmation. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>917123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            4(?:
              1[18]|
              4[02-479]
            )|
            81[1-9]
          )\d{6}|
          (?:
            0[0-57-9]|
            1[017]|
            2[02]|
            [34]0|
            5[05]|
            7[0178]|
            8[078]|
            9\d
          )\d{7}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Tokelau (TK) -->
    <!-- http://www.itu.int/oth/T02020000D2/en -->
    <territory id="TK" countryCode="690" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>[2-47]\d{3,6}</nationalNumberPattern>
      </generalDesc>
      <!-- The example number is the contact number from the ITU document. -->
      <fixedLine>
        <possibleLengths national="[4-7]"/>
        <exampleNumber>3101</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[2-4]|
            [34]\d
          )\d{2,5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- No evidence has been found for prefixes 5, 6, 8, and 9 which are
           described as non-geographic service numbers, so these prefixes are
           excluded until more information is found. -->
      <mobile>
        <possibleLengths national="[4-7]"/>
        <exampleNumber>7290</exampleNumber>
        <nationalNumberPattern>7[2-4]\d{2,5}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Timor-Leste (TL) -->
    <!-- http://www.itu.int/oth/T02020000D0/en -->
    <territory id="TL" countryCode="670" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            [2-489]|
            70
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Since numbers grew an extra digit, we have no indication of how people are formatting
             them. If we see another pattern being used, we should change this later. -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          7\d{7}|
          (?:
            [2-47]\d|
            [89]0
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7"/>
        <exampleNumber>2112345</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[1-5]|
            3[1-9]|
            4[1-4]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>77212345</exampleNumber>
        <nationalNumberPattern>7[2-8]\d{6}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>8012345</exampleNumber>
        <nationalNumberPattern>80\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>9012345</exampleNumber>
        <nationalNumberPattern>90\d{5}</nationalNumberPattern>
      </premiumRate>
      <!-- We don't include paging or voicemail because the identified paging range was used by
           mobile previously, and for voicemail, it is unclear if the 2012 change affected these
           numbers, or if the range was indeed previously used for voicemail at all. -->
      <!-- We presume this wasn't affected by the numbering plan update. -->
      <personalNumber>
        <possibleLengths national="7"/>
        <exampleNumber>7012345</exampleNumber>
        <nationalNumberPattern>70\d{5}</nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Turkmenistan (TM) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T02020000D7/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Turkmenistan -->
    <territory id="TM" countryCode="993" preferredInternationalPrefix="8~10"
               internationalPrefix="810" nationalPrefix="8">
      <availableFormats>
        <!-- There doesn't seem to be a standardized format. The format below is based on the
             Turkmenistan embassy at
             http://www.turkmenistanembassy.org/turkmen/info/contact.html -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})"
                      nationalPrefixFormattingRule="($NP $FG)">
          <leadingDigits>12</leadingDigits>
          <format>$1 $2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d)(\d{2})(\d{2})" nationalPrefixFormattingRule="($NP $FG)">
          <leadingDigits>[1-5]</leadingDigits>
          <format>$1 $2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{6})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-6]\d{7}</nationalNumberPattern>
      </generalDesc>
      <!-- Additional prefixes from the wikipedia page. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              2\d|
              3[1-9]
            )|
            2(?:
              22|
              4[0-35-8]
            )|
            3(?:
              22|
              4[03-9]
            )|
            4(?:
              22|
              3[128]|
              4\d|
              6[15]
            )|
            5(?:
              22|
              5[7-9]|
              6[014-689]
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- According to feedback from users, the carrier Altyn Asyr is the only one currently
           operating, with the numbers 6[3-5]\d{6}. MTS used to operate the ranges 6[6-8] but this
           has been suspended. It is unclear whether it will resume. We support both ranges in the
           meantime. The range 62 seems also now to be in use, according to numbers found online.
           MTS Turkmenistan have recently launched their NDC(69). So added range 69 after getting
           confirmation from the carriers who own them. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>66123456</exampleNumber>
        <nationalNumberPattern>6\d{7}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Tunisia (TN) -->
    <!-- http://www.itu.int/oth/T02020000D5/en -->
    <!-- http://www.tunisietelecom.tn/tt/wcm/connect/?MOD=PDMProxy&TYPE=personalization&ID=NONE&KEY=NONE&LIBRARY=%2FcontentRoot%2Ficm%3Alibraries%5B16%5D&FOLDER=%2F&DOC_NAME=%2FcontentRoot%2Ficm%3Alibraries%5B16%5D%2FOTTI+2011.pdf -->
    <!-- http://www.tunisietelecom.tn/tt/internet/fr/pme/fixe/numeros_acceuil -->
    <territory id="TN" countryCode="216" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
          <leadingDigits>[2-57-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[2-57-9]\d{7}</nationalNumberPattern>
      </generalDesc>
      <!-- All 3[0-2] range numbers are mentioned as fixed-line in 20.II.2012 ITU doc. Few of
           these are supported in mobile also as 28.IX.2015 ITU doc mentions these as "Restricted
           Mobility" numbers. -->
      <fixedLine>
        <possibleLengths national="8"/>
        <exampleNumber>30010123</exampleNumber>
        <nationalNumberPattern>
          81200\d{3}|
          (?:
            3[0-2]|
            7\d
          )\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <!-- All Restricted Mobility numbers mentioned in ITU doc are supported as mobile based on
           user report. -->
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>20123456</exampleNumber>
        <nationalNumberPattern>
          3(?:
            001|
            [12]40
          )\d{4}|
          (?:
            (?:
              [259]\d|
              4[0-8]
            )\d|
            3(?:
              1[1-35]|
              6[0-4]|
              91
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- ITU lists 80 xx xx xx, but the document published by Tunisie Telecom has more specific
           information which is followed here. -->
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80101234</exampleNumber>
        <nationalNumberPattern>8010\d{4}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>88123456</exampleNumber>
        <nationalNumberPattern>88\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- 8110xxxx numbers are listed as being "discounted non-geographical numbers" and are put
           here for now. In the future we might consider them as UAN.
           ITU lists 82 xx xx xx, but the document published by Tunisie Telecom has more specific
           information which is followed here. -->
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>81101234</exampleNumber>
        <nationalNumberPattern>8[12]10\d{4}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Tonga (TO) -->
    <!-- http://www.itu.int/oth/T02020000D3/en -->
    <!-- http://www.wtng.info/wtng-676-to.html -->
    <territory id="TO" countryCode="676" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})">
          <leadingDigits>
            [2-4]|
            50|
            6[09]|
            7[0-24-69]|
            8[05]
          </leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Format for mobile and premium rate numbers. -->
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[5-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            0800|
            (?:
              [5-8]\d\d|
              999
            )\d
          )\d{3}|
          [2-8]\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="5"/>
        <exampleNumber>20123</exampleNumber>
        <nationalNumberPattern>
          (?:
            2\d|
            3[0-8]|
            4[0-4]|
            50|
            6[09]|
            7[0-24-69]|
            8[05]
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <!-- TCC mobile numbers were given a prefix of "77" in 2009, although this is not mentioned
           in their ITU document. Numbers with a prefix of 75, 84 and 86 have also been found. -->
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>7715123</exampleNumber>
        <nationalNumberPattern>
          (?:
            5(?:
              4[0-5]|
              5[4-6]
            )|
            6(?:
              [09]\d|
              3[02]|
              8[15-9]
            )|
            (?:
              7\d|
              8[46-9]
            )\d|
            999
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>0800222</exampleNumber>
        <nationalNumberPattern>0800\d{3}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>5510123</exampleNumber>
        <nationalNumberPattern>55[0-37-9]\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Türkiye (TR) -->
    <!-- http://en.wikipedia.org/wiki/%2B90 -->
    <!-- http://www.itu.int/oth/T02020000D6/en -->
    <!-- https://eng.btk.gov.tr/en-US/Pages/National-Numbering-Plan -->
    <!-- https://www.btk.gov.tr/tr-TR/Sayfalar/Isletmecilere-Tahsisli-Numaralar -->
    <territory id="TR" countryCode="90" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 7-digit UAN. -->
        <numberFormat pattern="(\d{3})(\d)(\d{3})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>444</leadingDigits>
          <format>$1 $2 $3</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Fixed line, UAN, pager. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            512|
            8[01589]|
            90
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile and personal numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            5(?:
              [0-59]|
              61
            )
          </leadingDigits>
          <leadingDigits>
            5(?:
              [0-59]|
              61[06]
            )
          </leadingDigits>
          <leadingDigits>
            5(?:
              [0-59]|
              61[06]1
            )
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- In online references we see both these formats for mobile and fixed-line numbers:
             (\d{3})(\d{3})(\d{2})(\d{2}) and (\d{3})(\d{3})(\d{4}). However the former seems to be
             more common. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="($NP$FG)"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>
            [24][1-8]|
            3[1-9]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- 12 -13 digit toll free numbers -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{6,7})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>80</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          4\d{6}|
          8\d{11,12}|
          (?:
            [2-58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="7,10"/>
        <nationalNumberPattern>
          (?:
            444|
            811\d{3}
          )\d{4}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- Includes numbers starting with 392 for Northern Cyprus. Not supporting additionally
           allocated area codes that are mentioned in ITU doc dated 7.VII.2009 as these are not
           mentioned in new ITU doc dated 2.III.2018. -->
      <fixedLine>
        <possibleLengths national="10"/>
        <exampleNumber>2123456789</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              [13][26]|
              [28][2468]|
              [45][268]|
              [67][246]
            )|
            3(?:
              [13][28]|
              [24-6][2468]|
              [78][02468]|
              92
            )|
            4(?:
              [16][246]|
              [23578][2468]|
              4[26]
            )
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- There are some differences between the Turkish and English wikipedia pages here, and
           some number prefixes do not seem to be able to be found online. Omitting 500, 508 and
           509 from the English page because of this. -->
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>5012345678</exampleNumber>
        <nationalNumberPattern>
          561(?:
            011|
            61\d
          )\d{4}|
          5(?:
            0[15-7]|
            1[06]|
            24|
            [34]\d|
            5[1-59]|
            9[46]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- 512 range is mentioned as call services number in eng.btk.gov.tr's doc. As we not sure
           of the category, supporting them as pager based on Wikipedia. -->
      <pager>
        <possibleLengths national="10"/>
        <exampleNumber>5123456789</exampleNumber>
        <nationalNumberPattern>512\d{7}</nationalNumberPattern>
      </pager>
      <!-- Toll free range 800 of length 13 digits and 811 of length 10 digits are supported based
           on user report. -->
      <tollFree>
        <possibleLengths national="10,12,13"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00\d{7}(?:
              \d{2,3}
            )?|
            11\d{7}
          )
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            8[89]8|
            900
          )\d{7}
        </nationalNumberPattern>
      </premiumRate>
      <!-- All 592 numbers are GMPCS numbers (personal satellite numbers) as per ITU doc. We do
           support only the ranges that are assigned (max 6 digit granularity) based on
           eng.btk.gov.tr's doc. -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5922121234</exampleNumber>
        <nationalNumberPattern>
          592(?:
            21[12]|
            461
          )\d{4}
        </nationalNumberPattern>
      </personalNumber>
      <!-- Prefix 850 was earlier supported as UAN but after user report and other sources, found
           that they belong to VOIP. -->
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>8500123456</exampleNumber>
        <nationalNumberPattern>850\d{7}</nationalNumberPattern>
      </voip>
      <!-- http://www.turktelekom.com.tr/tt/portal/News/Archive/7-digit-special-service-number-starting-with-444 -->
      <uan>
        <possibleLengths national="7"/>
        <exampleNumber>4441444</exampleNumber>
        <nationalNumberPattern>444\d{4}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Trinidad & Tobago (TT) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000D4/en -->
    <territory id="TT" countryCode="1" leadingDigits="868" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-46-8]\d{6})$|1"
               nationalPrefixTransformRule="868$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Added support to 609, 61[0278], 699 and 824 fixed-line ranges based on official doc
           from TATT. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8682211234</exampleNumber>
        <nationalNumberPattern>
          868(?:
            2(?:
              01|
              1[5-9]|
              [23]\d|
              4[0-2]
            )|
            6(?:
              0[7-9]|
              1[02-8]|
              2[1-9]|
              [3-69]\d|
              7[0-79]
            )|
            82[124]
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- We support below mobile ranges additionally which are not listed in ITU doc.
           - 270: Found valid numbers online.
           - 26[6-9] and 48[5-9]: Evidence from bmobile.
           - 70[1-9]: Official TATT doc. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8682911234</exampleNumber>
        <nationalNumberPattern>
          868(?:
            (?:
              2[5-9]|
              3\d
            )\d|
            4(?:
              3[0-6]|
              [6-9]\d
            )|
            6(?:
              20|
              78|
              8\d
            )|
            7(?:
              0[1-9]|
              1[02-9]|
              [2-9]\d
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <voicemail>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>8686191234</exampleNumber>
        <nationalNumberPattern>868619\d{4}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Tuvalu (TV) -->
    <!-- http://www.itu.int/oth/T02020000D9/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Tuvalu -->
    <territory id="TV" countryCode="688" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})">
          <leadingDigits>90</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{5})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            2|
            7\d\d|
            90
          )\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="5"/>
        <exampleNumber>20123</exampleNumber>
        <nationalNumberPattern>2[02-9]\d{3}</nationalNumberPattern>
      </fixedLine>
      <!-- Some numbers online can be found that are 5-digits long, and start with 90 or 91. We
           don't know if these are valid or not - the ITU document excludes them - so are not
           covering these for now. -->
      <mobile>
        <possibleLengths national="6,7"/>
        <exampleNumber>901234</exampleNumber>
        <nationalNumberPattern>
          (?:
            7[01]\d|
            90
          )\d{4}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Taiwan (TW) -->
    <!-- Extension symbols found on the internet so far have been #, X and Ext - so # has been
         chosen as the preferred extension prefix. -->
    <!-- http://www.itu.int/oth/T02020000EB/en -->
    <!-- https://www.ncc.gov.tw/chinese/files/07080/265_1037_070808_1.doc -->
    <territory id="TW" countryCode="886" internationalPrefix="0(?:0[25-79]|19)" nationalPrefix="0"
               preferredExtnPrefix="#" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- Premium rate. -->
        <numberFormat pattern="(\d{2})(\d)(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>202</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line and UAN. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[258]0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line. -->
        <numberFormat pattern="(\d)(\d{3,4})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [23568]|
            4(?:
              0[02-48]|
              [1-47-9]
            )|
            7[1-9]
          </leadingDigits>
          <leadingDigits>
            [23568]|
            4(?:
              0[2-48]|
              [1-47-9]
            )|
            (?:
              400|
              7
            )[1-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Mobile and personal numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[49]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- VOIP. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [2-689]\d{8}|
          7\d{9,10}|
          [2-8]\d{7}|
          2\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Prefix 24 added due to numbers found online for two major commercial companies; it
           is possible they aren't fixed-line, but adding them here since we don't have better
           information for now. Prefix 90 is mentioned as reserved in http://www.ncc.gov.tw/
           and wikipedea states it as M2M, but we still support in Mobile as we were able to
           find working online number. Prefix 64 is added on the basis of user report. -->
      <fixedLine>
        <possibleLengths national="8,9"/>
        <exampleNumber>221234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[2-8]\d|
            370|
            55[01]|
            7[1-9]
          )\d{6}|
          4(?:
            (?:
              0(?:
                0[1-9]|
                [2-48]\d
              )|
              1[023]\d
            )\d{4,5}|
            (?:
              [239]\d\d|
              4(?:
                0[56]|
                12|
                49
              )
            )\d{5}
          )|
          6(?:
            [01]\d{7}|
            4(?:
              0[56]|
              12|
              24|
              4[09]
            )\d{4,5}
          )|
          8(?:
            (?:
              2(?:
                3\d|
                4[0-269]|
                [578]0|
                66
              )|
              36[24-9]|
              90\d\d
            )\d{4}|
            4(?:
              0[56]|
              12|
              24|
              4[09]
            )\d{4,5}
          )|
          (?:
            2(?:
              2(?:
                0\d\d|
                4(?:
                  0[68]|
                  [249]0|
                  3[0-467]|
                  5[0-25-9]|
                  6[0235689]
                )
              )|
              (?:
                3(?:
                  [09]\d|
                  1[0-4]
                )|
                (?:
                  4\d|
                  5[0-49]|
                  6[0-29]|
                  7[0-5]
                )\d
              )\d
            )|
            (?:
              (?:
                3[2-9]|
                5[2-8]|
                6[0-35-79]|
                8[7-9]
              )\d\d|
              4(?:
                2(?:
                  [089]\d|
                  7[1-9]
                )|
                (?:
                  3[0-4]|
                  [78]\d|
                  9[01]
                )\d
              )
            )\d
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            40001[0-2]|
            9[0-8]\d{4}
          )\d{3}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8,9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>
          80[0-79]\d{6}|
          800\d{5}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7,9"/>
        <exampleNumber>203123456</exampleNumber>
        <nationalNumberPattern>
          20(?:
            [013-9]\d\d|
            2
          )\d{4}
        </nationalNumberPattern>
      </premiumRate>
      <personalNumber>
        <possibleLengths national="9"/>
        <exampleNumber>990123456</exampleNumber>
        <nationalNumberPattern>99\d{7}</nationalNumberPattern>
      </personalNumber>
      <!-- http://www.chief.com.tw/telecom_eng/front/bin/ptlist.phtml?Category=107 -->
      <voip>
        <possibleLengths national="10,11"/>
        <exampleNumber>7012345678</exampleNumber>
        <nationalNumberPattern>
          7010(?:
            [0-2679]\d|
            3[0-7]|
            8[0-5]
          )\d{5}|
          70\d{8}
        </nationalNumberPattern>
      </voip>
      <uan>
        <possibleLengths national="9"/>
        <exampleNumber>500123456</exampleNumber>
        <nationalNumberPattern>50[0-46-9]\d{6}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Tanzania (TZ) -->
    <!-- http://www.itu.int/oth/T02020000CB/en -->
    <territory id="TZ" countryCode="255" internationalPrefix="00[056]" nationalPrefix="0">
      <availableFormats>
        <!-- Formatting for special numbers from http://www.tcra.go.tz -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[24]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- ITU format: +255 5X XXXXXXX -->
        <numberFormat pattern="(\d{2})(\d{7})">
          <leadingDigits>5</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[67]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [25-8]\d|
            41|
            90
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="9"/>
        <nationalNumberPattern>
          (?:
            8(?:
              [04]0|
              6[01]
            )|
            90\d
          )\d{6}
        </nationalNumberPattern>
      </noInternationalDialling>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>222345678</exampleNumber>
        <nationalNumberPattern>2[2-8]\d{7}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>621234567</exampleNumber>
        <nationalNumberPattern>
          77[2-9]\d{6}|
          (?:
            6[125-9]|
            7[13-689]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>80[08]\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>900123456</exampleNumber>
        <nationalNumberPattern>90\d{7}</nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>840123456</exampleNumber>
        <nationalNumberPattern>
          8(?:
            40|
            6[01]
          )\d{6}
        </nationalNumberPattern>
      </sharedCost>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>412345678</exampleNumber>
        <nationalNumberPattern>41\d{7}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Ukraine (UA) -->
    <!-- http://www.itu.int/oth/T02020000DB/en -->
    <!-- http://en.wikipedia.org/wiki/%2B380 -->
    <!-- No definitive list has been found of what constitutes the area code for formatting.
         http://www.ua.all-biz.info/guide/phonecodes is useful but not error-free.
         Have used local yellow pages guidelines, Google searches, regression tests
         and bugs to reverse-engineer the formatting rules. -->
    <territory id="UA" countryCode="380" preferredInternationalPrefix="0~0" internationalPrefix="00"
               nationalPrefix="0">
      <availableFormats>
        <!-- Fixed line -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            6[12][29]|
            (?:
              3[1-8]|
              4[136-8]|
              5[12457]|
              6[49]
            )2|
            (?:
              56|
              65
            )[24]
          </leadingDigits>
          <leadingDigits>
            6[12][29]|
            (?:
              35|
              4[1378]|
              5[12457]|
              6[49]
            )2|
            (?:
              56|
              65
            )[24]|
            (?:
              3[1-46-8]|
              46
            )2[013-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Fixed line (4-digit area code). -->
        <numberFormat pattern="(\d{4})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            3[1-8]|
            4(?:
              [1367]|
              [45][6-9]|
              8[4-6]
            )|
            5(?:
              [1-5]|
              6[0135689]|
              7[4-6]
            )|
            6(?:
              [12][3-7]|
              [459]
            )
          </leadingDigits>
          <leadingDigits>
            3[1-8]|
            4(?:
              [1367]|
              [45][6-9]|
              8[4-6]
            )|
            5(?:
              [1-5]|
              6(?:
                [015689]|
                3[02389]
              )|
              7[4-6]
            )|
            6(?:
              [12][3-7]|
              [459]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- General format (fixed line, mobile, voip etc.) -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [3-7]|
            89|
            9[1-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Premium Rate and Toll Free -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [89]\d{9}|
          [3-9]\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Official numbering plan https://regulation.gov.ua/documents/id89506 (Dated: 23.11.2006)
           mentions that xx[018] (xx represents valid area code) fixed-line numbers as invalid and
           we are also unable to find valid numbers online. This doc is already outdated and
           contradicted (Eg: length of NSN) by some more recent evidence. Considering the impact
           we choose not to mark those ranges as invalid. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="[5-7]"/>
        <exampleNumber>311234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[1-8]|
            4[13-8]|
            5[1-7]|
            6[12459]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Added 71 prefix based on user report and 72 based on online numbers.  -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>501234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            39|
            50|
            6[36-8]|
            7[1-3]|
            9[1-9]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9,10"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800[1-8]\d{5,6}</nationalNumberPattern>
      </tollFree>
      <!-- 4th digit added based on
           http://www.mts.ua/ru/support/services/200-tarify-na-nomera-0-800-0-900-0-703/ -->
      <premiumRate>
        <possibleLengths national="9,10"/>
        <exampleNumber>900212345</exampleNumber>
        <nationalNumberPattern>900[239]\d{5,6}</nationalNumberPattern>
      </premiumRate>
      <!-- 89[1-579] ranges are mentioned as "Non-geographic number – mobile services assigned" in
           the ITU doc. All the 89X phone numbers found online are listed as conference calls and
           skype calls which are actually VOIP. And also the companies to which these ranges are
           assigned (as per ITU doc) are more of VOIP service providers. So supporting them under
           VOIP. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>891234567</exampleNumber>
        <nationalNumberPattern>89[1-579]\d{6}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Uganda (UG) -->
    <!-- http://www.itu.int/oth/T02020000F1/en -->
    <territory id="UG" countryCode="256" internationalPrefix="00[057]" nationalPrefix="0">
      <availableFormats>
        <!-- 4-digit area codes -->
        <numberFormat pattern="(\d{4})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>202</leadingDigits>
          <leadingDigits>2024</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Fixed and mobile format. -->
        <numberFormat pattern="(\d{3})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [27-9]|
            4(?:
              6[45]|
              [7-9]
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 2-digit area codes -->
        <numberFormat pattern="(\d{2})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[34]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          800\d{6}|
          (?:
            [29]0|
            [347]\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The ITU plan calls for all numbers to be exactly 9 digits. However, it's not clear if
           local dialing is still possible. We assume it is for now. -->
      <!-- The prefix 202[5-9] was added as per the ITU update on Oct. 2011. It is not
           mentioned in the new ITU docs but they are still valid based on online
           evidence. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="[5-7]"/>
        <exampleNumber>312345678</exampleNumber>
        <nationalNumberPattern>
          20(?:
            (?:
              240|
              30[67]
            )\d|
            6(?:
              00[0-2]|
              30[0-4]
            )
          )\d{3}|
          (?:
            20(?:
              [017]\d|
              2[5-9]|
              3[1-4]|
              5[0-4]|
              6[15-9]
            )|
            [34]\d{3}
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Supporting 7[09][89] based on carrier docs. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>712345678</exampleNumber>
        <nationalNumberPattern>
          72(?:
            [48]0|
            6[01]
          )\d{5}|
          7(?:
            [015-8]\d|
            20|
            36|
            4[0-4]|
            9[89]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800[1-3]\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>901123456</exampleNumber>
        <nationalNumberPattern>90[1-3]\d{6}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- United States (US) -->
    <!-- Main region for 'AG,AI,AS,BB,BM,BS,CA,DM,DO,GD,GU,JM,KN,KY,LC,MP,MS,PR,SX,TC,TT,VC,VG,VI' -->
    <!-- Note the national prefix of US is the same as its country code, and when formatting phone
         numbers in the national format, it is not included. Therefore, we omit it here to make
         formatting consistent with the rest of the world. The same applies to all the
         countries/regions under NANPA -->
    <!-- The national prefix of "1" here is the same as the country code. It is not used by default
         when formatting, but is set here so that users who are calling formatByPattern can specify
         NationalPrefixFormattingRule if they want to. -->
    <!-- http://www.nanpa.com/reports/reports_npa.html -->
    <!-- http://en.wikipedia.org/wiki/North_American_Numbering_Plan -->
    <territory id="US" mainCountryForCode="true" countryCode="1" internationalPrefix="011"
               nationalPrefix="1" mobileNumberPortableRegion="true">
      <availableFormats>
        <!-- 310-xxxx (7 digit) UAN numbers . -->
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>310</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>
            [24-9]|
            3(?:
              [02-9]|
              1[1-9]
            )
          </leadingDigits>
          <format>$1-$2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- A different pattern is used when formatting internationally, as the area code is no
             longer optional and should not be in brackets. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[2-9]</leadingDigits>
          <format>($1) $2-$3</format>
          <intlFormat>$1-$2-$3</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [2-9]\d{9}|
          3\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2015550123</exampleNumber>
        <nationalNumberPattern>
          (?:
            5056(?:
              [0-35-9]\d|
              4[468]
            )|
            7302[0-3]\d
          )\d{4}|
          (?:
            472[24]|
            505[2-57-9]|
            7306|
            983[237-9]
          )\d{6}|
          (?:
            2(?:
              0[1-35-9]|
              1[02-9]|
              2[03-57-9]|
              3[149]|
              4[08]|
              5[1-46]|
              6[0279]|
              7[0269]|
              8[13]
            )|
            3(?:
              0[1-57-9]|
              1[02-9]|
              2[013569]|
              3[0-24679]|
              4[167]|
              5[0-2]|
              6[01349]|
              8[056]
            )|
            4(?:
              0[124-9]|
              1[02-579]|
              2[3-5]|
              3[0245]|
              4[023578]|
              58|
              6[349]|
              7[0589]|
              8[04]
            )|
            5(?:
              0[1-47-9]|
              1[0235-8]|
              20|
              3[0149]|
              4[01]|
              5[179]|
              6[1-47]|
              7[0-5]|
              8[0256]
            )|
            6(?:
              0[1-35-9]|
              1[024-9]|
              2[03689]|
              3[016]|
              4[0156]|
              5[01679]|
              6[0-279]|
              78|
              8[0-29]
            )|
            7(?:
              0[1-46-8]|
              1[2-9]|
              2[04-8]|
              3[1247]|
              4[037]|
              5[47]|
              6[02359]|
              7[0-59]|
              8[156]
            )|
            8(?:
              0[1-68]|
              1[02-8]|
              2[068]|
              3[0-2589]|
              4[03578]|
              5[046-9]|
              6[02-5]|
              7[028]
            )|
            9(?:
              0[1346-9]|
              1[02-9]|
              2[0589]|
              3[0146-8]|
              4[01357-9]|
              5[12469]|
              7[0-389]|
              8[04-69]
            )
          )[2-9]\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2015550123</exampleNumber>
        <nationalNumberPattern>
          (?:
            5056(?:
              [0-35-9]\d|
              4[468]
            )|
            7302[0-3]\d
          )\d{4}|
          (?:
            472[24]|
            505[2-57-9]|
            7306|
            983[237-9]
          )\d{6}|
          (?:
            2(?:
              0[1-35-9]|
              1[02-9]|
              2[03-57-9]|
              3[149]|
              4[08]|
              5[1-46]|
              6[0279]|
              7[0269]|
              8[13]
            )|
            3(?:
              0[1-57-9]|
              1[02-9]|
              2[013569]|
              3[0-24679]|
              4[167]|
              5[0-2]|
              6[01349]|
              8[056]
            )|
            4(?:
              0[124-9]|
              1[02-579]|
              2[3-5]|
              3[0245]|
              4[023578]|
              58|
              6[349]|
              7[0589]|
              8[04]
            )|
            5(?:
              0[1-47-9]|
              1[0235-8]|
              20|
              3[0149]|
              4[01]|
              5[179]|
              6[1-47]|
              7[0-5]|
              8[0256]
            )|
            6(?:
              0[1-35-9]|
              1[024-9]|
              2[03689]|
              3[016]|
              4[0156]|
              5[01679]|
              6[0-279]|
              78|
              8[0-29]
            )|
            7(?:
              0[1-46-8]|
              1[2-9]|
              2[04-8]|
              3[1247]|
              4[037]|
              5[47]|
              6[02359]|
              7[0-59]|
              8[156]
            )|
            8(?:
              0[1-68]|
              1[02-8]|
              2[068]|
              3[0-2589]|
              4[03578]|
              5[046-9]|
              6[02-5]|
              7[028]
            )|
            9(?:
              0[1346-9]|
              1[02-9]|
              2[0589]|
              3[0146-8]|
              4[01357-9]|
              5[12469]|
              7[0-389]|
              8[04-69]
            )
          )[2-9]\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Uruguay (UY) -->
    <!-- International long-distance providers can be dialled by dialling 01 followed by a carrier
         code JK, where J = [3-9] and K is any digit. -->
    <!-- http://www.itu.int/oth/T02020000E0/en -->
    <!-- http://www.ursec.gub.uy -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Uruguay -->
    <territory id="UY" countryCode="598" preferredInternationalPrefix="00"
               internationalPrefix="0(?:0|1[3-9]\d)" nationalPrefix="0" preferredExtnPrefix=" int. ">
      <availableFormats>
        <!-- 6 - 7 digit toll free numbers -->
        <numberFormat pattern="(\d{3})(\d{3,4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [49]0|
            8
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Including the national prefix here since URSEC does when formatting these. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Following paginasamarillas.com.uy formatting. -->
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[124]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- 8 - 10 digit toll free numbers -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2,4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 11 - 13 digit toll free numbers -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{2,4})">
          <leadingDigits>0</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          0004\d{2,9}|
          [1249]\d{7}|
          (?:
            [49]\d|
            80
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Prefix 1770 and 1987 are added based on online numbers. -->
      <fixedLine>
        <possibleLengths national="8" localOnly="7"/>
        <exampleNumber>21231234</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              770|
              9(?:
                20|
                87
              )
            )|
            (?:
              2\d|
              4[2-7]
            )\d\d
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>94231234</exampleNumber>
        <nationalNumberPattern>9[1-9]\d{6}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="[6-13]"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>
          0004\d{2,9}|
          (?:
            405|
            80[05]
          )\d{4}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="7"/>
        <exampleNumber>9001234</exampleNumber>
        <nationalNumberPattern>90[0-8]\d{4}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Uzbekistan (UZ) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- http://www.ttts.uz/eng/telephone_codes/codes_uzb_eng -->
    <!-- http://www.itu.int/oth/T02020000E1/en -->
    <territory id="UZ" countryCode="998" preferredInternationalPrefix="8~10"
               internationalPrefix="810" nationalPrefix="8">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP $FG">
          <leadingDigits>[235-9]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            20|
            33|
            [5-79]\d|
            88
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Adding 711 from numbers found online, such as the US embassy, and 6922, which seems to
           be used in Namangan. -->
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>669050123</exampleNumber>
        <nationalNumberPattern>
          (?:
            55\d\d|
            6(?:
              1(?:
                22|
                3[124]|
                4[1-4]|
                5[1-3578]|
                64
              )|
              2(?:
                22|
                3[0-57-9]|
                41
              )|
              5(?:
                22|
                3[3-7]|
                5[024-8]
              )|
              6\d\d|
              7(?:
                [23]\d|
                7[69]
              )|
              9(?:
                22|
                4[1-8]|
                6[135]
              )
            )|
            7(?:
              0(?:
                5[4-9]|
                6[0146]|
                7[124-6]|
                9[135-8]
              )|
              (?:
                1[12]|
                [68]\d
              )\d|
              2(?:
                22|
                3[13-57-9]|
                4[1-3579]|
                5[14]
              )|
              3(?:
                2\d|
                3[1578]|
                4[1-35-7]|
                5[1-57]|
                61
              )|
              4(?:
                2\d|
                3[1-579]|
                7[1-79]
              )|
              5(?:
                22|
                5[1-9]|
                6[1457]
              )|
              9(?:
                22|
                5[1-9]
              )
            )
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 9[45] as suggested by http://www.ucell.uz/en/for_subscribers/how_to_call.html
           Adding other prefixes from http://www.weltvorwahlen.de/99861353.html, and any other
           prefixes Tyntec has a carrier mapped to. Adding 5550[013] & 5590 based on user report. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            (?:
              [25]0|
              33|
              88|
              9[0-57-9]
            )\d{3}|
            6(?:
              1(?:
                2(?:
                  2[01]|
                  98
                )|
                35[0-4]|
                50\d|
                61[23]|
                7(?:
                  [01][017]|
                  4\d|
                  55|
                  9[5-9]
                )
              )|
              2(?:
                (?:
                  11|
                  7\d
                )\d|
                2(?:
                  [12]1|
                  9[01379]
                )|
                5(?:
                  [126]\d|
                  3[0-4]
                )
              )|
              5(?:
                19[01]|
                2(?:
                  27|
                  9[26]
                )|
                (?:
                  30|
                  59|
                  7\d
                )\d
              )|
              6(?:
                2(?:
                  1[5-9]|
                  2[0367]|
                  38|
                  41|
                  52|
                  60
                )|
                (?:
                  3[79]|
                  9[0-3]
                )\d|
                4(?:
                  56|
                  83
                )|
                7(?:
                  [07]\d|
                  1[017]|
                  3[07]|
                  4[047]|
                  5[057]|
                  67|
                  8[0178]|
                  9[79]
                )
              )|
              7(?:
                2(?:
                  24|
                  3[237]|
                  4[5-9]|
                  7[15-8]
                )|
                5(?:
                  7[12]|
                  8[0589]
                )|
                7(?:
                  0\d|
                  [39][07]
                )|
                9(?:
                  0\d|
                  7[079]
                )
              )|
              9(?:
                2(?:
                  1[1267]|
                  3[01]|
                  5\d|
                  7[0-4]
                )|
                (?:
                  5[67]|
                  7\d
                )\d|
                6(?:
                  2[0-26]|
                  8\d
                )
              )
            )|
            7(?:
              [07]\d{3}|
              1(?:
                13[01]|
                6(?:
                  0[47]|
                  1[67]|
                  66
                )|
                71[3-69]|
                98\d
              )|
              2(?:
                2(?:
                  2[79]|
                  95
                )|
                3(?:
                  2[5-9]|
                  6[0-6]
                )|
                57\d|
                7(?:
                  0\d|
                  1[17]|
                  2[27]|
                  3[37]|
                  44|
                  5[057]|
                  66|
                  88
                )
              )|
              3(?:
                2(?:
                  1[0-6]|
                  21|
                  3[469]|
                  7[159]
                )|
                (?:
                  33|
                  9[4-6]
                )\d|
                5(?:
                  0[0-4]|
                  5[579]|
                  9\d
                )|
                7(?:
                  [0-3579]\d|
                  4[0467]|
                  6[67]|
                  8[078]
                )
              )|
              4(?:
                2(?:
                  29|
                  5[0257]|
                  6[0-7]|
                  7[1-57]
                )|
                5(?:
                  1[0-4]|
                  8\d|
                  9[5-9]
                )|
                7(?:
                  0\d|
                  1[024589]|
                  2[0-27]|
                  3[0137]|
                  [46][07]|
                  5[01]|
                  7[5-9]|
                  9[079]
                )|
                9(?:
                  7[015-9]|
                  [89]\d
                )
              )|
              5(?:
                112|
                2(?:
                  0\d|
                  2[29]|
                  [49]4
                )|
                3[1568]\d|
                52[6-9]|
                7(?:
                  0[01578]|
                  1[017]|
                  [23]7|
                  4[047]|
                  [5-7]\d|
                  8[78]|
                  9[079]
                )
              )|
              9(?:
                22[128]|
                3(?:
                  2[0-4]|
                  7\d
                )|
                57[02569]|
                7(?:
                  2[05-9]|
                  3[37]|
                  4\d|
                  60|
                  7[2579]|
                  87|
                  9[07]
                )
              )
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Vatican City (VA) -->
    <!-- Calling code and formatting shared with 'IT' -->
    <!-- Vatican City is assigned country code 379. However, Vatican City is still reached
         via the Italian numbering plan. Telephone numbers in Vatican City are integrated into
         the Italian telephone numbering plan. Telephone numbers in the Vatican City are similar
         to telephone numbers in Rome, with "698" following the "06" for Rome.
         A Vatican telephone number is in the form of 06 698x xxxx. -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_Vatican_City -->
    <territory id="VA" countryCode="39" leadingDigits="06698" internationalPrefix="00"
               mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          0\d{5,10}|
          3[0-8]\d{7,10}|
          55\d{8}|
          8\d{5}(?:
            \d{2,4}
          )?|
          (?:
            1\d|
            39
          )\d{7,8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- As per Wikipedia only 10 digit 06 698 is assigned to Vatican City. However in reality we
           were able to dial lesser length number that belongs to Vatican City. So added all the
           lengths as mentioned in ITU Doc. -->
      <fixedLine>
        <possibleLengths national="[6-11]"/>
        <exampleNumber>0669812345</exampleNumber>
        <nationalNumberPattern>06698\d{1,6}</nationalNumberPattern>
      </fixedLine>
      <!-- Mobile, toll free, premium rate, shared cost, personal number and VOIP copied from Italy. -->
      <!-- According to wikipedia, TIM mobile numbers can be 9 digits long, but all others are 10
           digits long. However, a user reported the existence of new 11 digit long numbers for
           TIM with the prefix 33X, so this is supported also. -->
      <mobile>
        <possibleLengths national="9,10"/>
        <exampleNumber>3123456789</exampleNumber>
        <nationalNumberPattern>
          3[1-9]\d{8}|
          3[2-9]\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="6,9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>
          80(?:
            0\d{3}|
            3
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <!-- Adding 0878 numbers, as per
           http://www.aduc.it/notizia/polizia+mette+allerta+sul+numero+0878_73136.php. Other
           premium prefixes are mentioned here:
           http://www.dirittodellinformatica.it/news/telefonia/agcom-blocco-permanente-prefissi-144-166-892-899-20080520241.html -->
      <premiumRate>
        <possibleLengths national="6,[8-10]"/>
        <exampleNumber>899123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            0878\d{3}|
            89(?:
              2\d|
              3[04]|
              4(?:
                [0-4]|
                [5-9]\d\d
              )|
              5[0-4]
            )
          )\d\d|
          (?:
            1(?:
              44|
              6[346]
            )|
            89(?:
              38|
              5[5-9]|
              9
            )
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="6,9"/>
        <exampleNumber>848123456</exampleNumber>
        <nationalNumberPattern>
          84(?:
            [08]\d{3}|
            [17]
          )\d{3}
        </nationalNumberPattern>
      </sharedCost>
      <personalNumber>
        <possibleLengths national="9,10"/>
        <exampleNumber>1781234567</exampleNumber>
        <nationalNumberPattern>
          1(?:
            78\d|
            99
          )\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>5512345678</exampleNumber>
        <nationalNumberPattern>55\d{8}</nationalNumberPattern>
      </voip>
      <voicemail>
        <possibleLengths national="11,12"/>
        <exampleNumber>33101234501</exampleNumber>
        <nationalNumberPattern>3[2-8]\d{9,10}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- St. Vincent & Grenadines (VC) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000B3/en -->
    <territory id="VC" countryCode="1" leadingDigits="784" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-7]\d{6})$|1"
               nationalPrefixTransformRule="784$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [58]\d\d|
            784|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- For 570, 571 and 572 prefixes, we believe the ITU doc incorrectly listed them to be under
           area code 758, which should be 784. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7842661234</exampleNumber>
        <nationalNumberPattern>
          784(?:
            266|
            3(?:
              6[6-9]|
              7\d|
              8[0-6]
            )|
            4(?:
              38|
              5[0-36-8]|
              8[0-8]
            )|
            5(?:
              55|
              7[0-2]|
              93
            )|
            638|
            784
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Supported 49[67] XXXX mobile ranges based on user report. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7844301234</exampleNumber>
        <nationalNumberPattern>
          784(?:
            4(?:
              3[0-5]|
              5[45]|
              89|
              9[0-8]
            )|
            5(?:
              2[6-9]|
              3[0-4]
            )|
            720
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
      <voip>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>7845101234</exampleNumber>
        <nationalNumberPattern>78451[0-2]\d{4}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Venezuela (VE) -->
    <!-- 1XX specifies a particular carrier to route a call to, but none of these have been
         implemented. -->
    <!-- http://www.itu.int/oth/T02020000E3/en -->
    <!-- http://en.wikipedia.org/wiki/+58 -->
    <territory id="VE" countryCode="58" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{7})" nationalPrefixFormattingRule="$NP$FG"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>[24-689]</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [68]00\d{7}|
          (?:
            [24]\d|
            [59]0
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Including region-free 500 calls here, since these are treated as local calls. Wikipedia
           mentions these as 5XX, but online examples that can be found are seemingly restricted
           to 50[01]. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2121234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              12|
              3[457-9]|
              [467]\d|
              [58][1-9]|
              9[1-6]
            )|
            [4-6]00
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>4121234567</exampleNumber>
        <nationalNumberPattern>
          4(?:
            1[24-8]|
            2[46]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
        <nationalNumberPattern>90[01]\d{7}</nationalNumberPattern>
      </premiumRate>
      <uan>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>5010123456</exampleNumber>
        <nationalNumberPattern>501\d{7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- British Virgin Islands (VG) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T020200001E/en -->
    <territory id="VG" countryCode="1" leadingDigits="284" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-578]\d{6})$|1"
               nationalPrefixTransformRule="284$1" mobileNumberPortableRegion="true">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            284|
            [58]\d\d|
            900
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- No data on central office codes can be found on the nanpa.com website. The codes 422
           and 774 have been added from numbers found in the white pages. -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2842291234</exampleNumber>
        <nationalNumberPattern>
          284(?:
            229|
            4(?:
              22|
              9[45]
            )|
            774|
            8(?:
              52|
              6[459]
            )
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- No data on central office codes can be found on the nanpa.com website. The codes 446
           and 54[57] have been added from numbers found in the white pages. -->
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2843001234</exampleNumber>
        <nationalNumberPattern>
          284(?:
            245|
            3(?:
              0[0-3]|
              4[0-7]|
              68|
              9[34]
            )|
            4(?:
              4[0-6]|
              68|
              9[69]
            )|
            5(?:
              4[0-7]|
              68|
              9[69]
            )
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- U.S. Virgin Islands (VI) -->
    <!-- Calling code and formatting shared with 'US' -->
    <!-- http://www.itu.int/oth/T02020000DF/en -->
    <territory id="VI" countryCode="1" leadingDigits="340" internationalPrefix="011"
               nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
               nationalPrefixTransformRule="340$1">
      <generalDesc>
        <nationalNumberPattern>
          [58]\d{9}|
          (?:
            34|
            90
          )0\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The ITU document seems a bit out-of-date so extra prefixes based on numbers in the
           yellow pages have been added, and the list of exchanges found on
           http://www.allareacodes.com/340 -->
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>3406421234</exampleNumber>
        <nationalNumberPattern>
          340(?:
            2(?:
              0[0-368]|
              2[06-8]|
              4[49]|
              77
            )|
            3(?:
              32|
              44
            )|
            4(?:
              2[23]|
              44|
              7[34]|
              89
            )|
            5(?:
              1[34]|
              55
            )|
            6(?:
              2[56]|
              4[23]|
              77|
              9[023]
            )|
            7(?:
              1[2-57-9]|
              2[57]|
              7\d
            )|
            884|
            998
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>3406421234</exampleNumber>
        <nationalNumberPattern>
          340(?:
            2(?:
              0[0-368]|
              2[06-8]|
              4[49]|
              77
            )|
            3(?:
              32|
              44
            )|
            4(?:
              2[23]|
              44|
              7[34]|
              89
            )|
            5(?:
              1[34]|
              55
            )|
            6(?:
              2[56]|
              4[23]|
              77|
              9[023]
            )|
            7(?:
              1[2-57-9]|
              2[57]|
              7\d
            )|
            884|
            998
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="10"/>
        <exampleNumber>8002345678</exampleNumber>
        <nationalNumberPattern>
          8(?:
            00|
            33|
            44|
            55|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="10"/>
        <exampleNumber>9002345678</exampleNumber>
        <nationalNumberPattern>900[2-9]\d{6}</nationalNumberPattern>
      </premiumRate>
      <!-- https://www.nationalnanpa.com/number_resource_info/5XX_codes.html -->
      <personalNumber>
        <possibleLengths national="10"/>
        <exampleNumber>5002345678</exampleNumber>
        <nationalNumberPattern>
          52(?:
            3(?:
              [2-46-9][02-9]\d|
              5(?:
                [02-46-9]\d|
                5[0-46-9]
              )
            )|
            4(?:
              [2-478][02-9]\d|
              5(?:
                [034]\d|
                2[024-9]|
                5[0-46-9]
              )|
              6(?:
                0[1-9]|
                [2-9]\d
              )|
              9(?:
                [05-9]\d|
                2[0-5]|
                49
              )
            )
          )\d{4}|
          52[34][2-9]1[02-9]\d{4}|
          5(?:
            00|
            2[125-9]|
            33|
            44|
            66|
            77|
            88
          )[2-9]\d{6}
        </nationalNumberPattern>
      </personalNumber>
    </territory>

    <!-- Vietnam (VN) -->
    <!-- http://www.itu.int/oth/T02020000E4/en -->
    <!-- http://en.wikipedia.org/wiki/%2B84 -->
    <territory id="VN" countryCode="84" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- National only UAN -->
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[17]99</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- UAN, but not marked as national only (there are instance of numbers in these ranges
             formatted for international dialling online, but they could be auto-generated). -->
        <numberFormat pattern="(\d{2})(\d{5})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>80</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- National only UAN -->
        <numberFormat pattern="(\d{3})(\d{4,5})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>69</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Non-geographic fixed line (toll free / standard rate) -->
        <numberFormat pattern="(\d{4})(\d{4,6})" nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Format for old mobile ranges and VOIP. -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>[357-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 2-digit area codes (big cities) -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>2[48]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 3-digit area codes -->
        <numberFormat pattern="(\d{3})(\d{4})(\d{3})" nationalPrefixFormattingRule="$NP$FG"
                      nationalPrefixOptionalWhenFormatting="true">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [12]\d{9}|
          [135-9]\d{8}|
          [16]\d{7}|
          [16-8]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <noInternationalDialling>
        <possibleLengths national="7,8"/>
        <nationalNumberPattern>
          [17]99\d{4}|
          69\d{5,6}
        </nationalNumberPattern>
      </noInternationalDialling>
      <!-- While 24 and 28 are the new area codes for Hanoi and Ho Chi Minh respectively, currently
           only 24[2-8] and 28[2-7] are in use. Reporter mentioned prefix 866 is Mobile but was
           unable to receive SMS so for now supporting in both Mobile and Fixed-line. Range 289 is
           added based on user report. -->
      <fixedLine>
        <possibleLengths national="10"/>
        <exampleNumber>2101234567</exampleNumber>
        <nationalNumberPattern>
          2(?:
            0[3-9]|
            1[0-689]|
            2[0-25-9]|
            [38][2-9]|
            4[2-8]|
            5[124-9]|
            6[0-39]|
            7[0-7]|
            9[0-4679]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- For the 8\d{8} range, we have clearer & more recent information available from IR.21
           docs than from ITU. Thus we consider 88x, 868, 89[89] as mobile ranges. 86[259] has been
           added to Mobile as per a user report. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            5(?:
              2[238]|
              59
            )|
            89[6-9]|
            99[013-9]
          )\d{6}|
          (?:
            3\d|
            5[1689]|
            7[06-9]|
            8[1-8]|
            9[0-8]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- As per the user and update from carrier it seems that numbers starting with 1800 are
           renumbered to 1228. Because we don't have complete update,supporting both the ranges
           at present.
           Prefix 120[13] is toll free number and is diallable from Orange Business Services based
           on user report. As we do not have official document mentioning the cost of the range,
           we have added it here for now. -->
      <tollFree>
        <possibleLengths national="[8-10]"/>
        <exampleNumber>1800123456</exampleNumber>
        <nationalNumberPattern>
          1800\d{4,6}|
          12(?:
            0[13]|
            28
          )\d{4}
        </nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="[8-10]"/>
        <exampleNumber>1900123456</exampleNumber>
        <nationalNumberPattern>1900\d{4,6}</nationalNumberPattern>
      </premiumRate>
      <!-- 672 is a VSAT numbering range as per ITU doc. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>672012345</exampleNumber>
        <nationalNumberPattern>672\d{6}</nationalNumberPattern>
      </voip>
      <!-- These include non-geographic fixed numbers, such as for government ministries. While
           listed as "private networks", they may actually be callable from within Vietnam. (They
           are "private" in the sense that ordinary people could not be assigned these numbers.) -->
      <uan>
        <possibleLengths national="7,8"/>
        <exampleNumber>1992000</exampleNumber>
        <nationalNumberPattern>
          (?:
            [17]99|
            80\d
          )\d{4}|
          69\d{5,6}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Vanuatu (VU) -->
    <!-- http://www.itu.int/oth/T02020000E2/en -->
    <!-- Should be formatted in one block, apart from the mobile numbers. -->
    <territory id="VU" countryCode="678" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>[57-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [57-9]\d{6}|
          (?:
            [238]\d|
            48
          )\d{3}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="5"/>
        <exampleNumber>22123</exampleNumber>
        <nationalNumberPattern>
          (?:
            38[0-8]|
            48[4-9]
          )\d\d|
          (?:
            2[02-9]|
            3[4-7]|
            88
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="7"/>
        <exampleNumber>5912345</exampleNumber>
        <nationalNumberPattern>
          (?:
            [58]\d|
            7[013-7]
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="5"/>
        <exampleNumber>81123</exampleNumber>
        <nationalNumberPattern>81[18]\d\d</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="7"/>
        <exampleNumber>9010123</exampleNumber>
        <nationalNumberPattern>
          9(?:
            0[1-9]|
            1[01]
          )\d{4}
        </nationalNumberPattern>
      </voip>
      <!-- Using this for non-geographical numbers, since they have not been clearly defined, and
           for government fixed-line numbers. -->
      <uan>
        <possibleLengths national="5,7"/>
        <exampleNumber>30123</exampleNumber>
        <nationalNumberPattern>
          (?:
            3[03]|
            900\d
          )\d{3}
        </nationalNumberPattern>
      </uan>
    </territory>

    <!-- Wallis & Futuna (WF) -->
    <!-- http://www.itu.int/oth/T02020000E6/en -->
    <territory id="WF" countryCode="681" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[478]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            40|
            72
          )\d{4}|
          8\d{5}(?:
            \d{3}
          )?
        </nationalNumberPattern>
      </generalDesc>
      <!-- Web searching only finds examples with the 72 prefix but the ITU document states that
           50 and 68 are possible, so they are included here. -->
      <fixedLine>
        <possibleLengths national="6"/>
        <exampleNumber>721234</exampleNumber>
        <nationalNumberPattern>72\d{4}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="6"/>
        <exampleNumber>821234</exampleNumber>
        <nationalNumberPattern>
          (?:
            72|
            8[23]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- As per ARCEP, mainland France and overseas territories use 0800 to 0805 as Toll-free
           numbers. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800012345</exampleNumber>
        <nationalNumberPattern>80[0-5]\d{6}</nationalNumberPattern>
      </tollFree>
      <voicemail>
        <possibleLengths national="6"/>
        <exampleNumber>401234</exampleNumber>
        <nationalNumberPattern>[48]0\d{4}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- Samoa (WS) -->
    <!-- http://www.itu.int/oth/T02020000B4/en -->
    <territory id="WS" countryCode="685" internationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{5})">
          <leadingDigits>
            [2-5]|
            6[1-9]
          </leadingDigits>
          <format>$1</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3,7})">
          <leadingDigits>[68]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{5})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [2-6]|
            8\d{5}
          )\d{4}|
          [78]\d{6}|
          [68]\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="5,6"/>
        <exampleNumber>22123</exampleNumber>
        <nationalNumberPattern>
          6[1-9]\d{3}|
          (?:
            [2-5]|
            60
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Under 89, only 8900000[0-2]xx + 8900000300 are assigned, and the operator seems to be
           the government. -->
      <mobile>
        <possibleLengths national="7,10"/>
        <exampleNumber>7212345</exampleNumber>
        <nationalNumberPattern>
          (?:
            7[1-35-7]|
            8(?:
              [3-7]|
              9\d{3}
            )
          )\d{5}
        </nationalNumberPattern>
      </mobile>
      <!-- The 800 number series is new, and is used by companies such as the ANZ bank in Samoa to
           provide 24 hour eMerchant support. It is marked as "Customized Services" in the plan
           for now, so may be also used for other purposes than toll free, but until we have
           further evidence of these we will keep it as toll free. -->
      <tollFree>
        <possibleLengths national="6"/>
        <exampleNumber>800123</exampleNumber>
        <nationalNumberPattern>800\d{3}</nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Kosovo (XK) -->
    <!-- https://www.itu.int/oth/T02020000FD/en -->
    <!-- http://arkep-rks.org/?cid=1,50 -->
    <territory id="XK" countryCode="383" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[2-4]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[23]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [23]\d{7,8}|
          (?:
            4\d\d|
            [89]00
          )\d{5}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="8,9"/>
        <exampleNumber>28012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            2[89]|
            39
          )0\d{6}|
          [23][89]\d{6}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="8"/>
        <exampleNumber>43201234</exampleNumber>
        <nationalNumberPattern>4[3-9]\d{6}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>80001234</exampleNumber>
        <nationalNumberPattern>800\d{5}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="8"/>
        <exampleNumber>90001234</exampleNumber>
        <nationalNumberPattern>900\d{5}</nationalNumberPattern>
      </premiumRate>
    </territory>

    <!-- Yemen (YE) -->
    <!-- No tollFree or premiumRate information can be found. -->
    <!-- http://www.itu.int/oth/T02020000E7/en -->
    <territory id="YE" countryCode="967" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            [1-6]|
            7(?:
              [24-6]|
              8[0-7]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            1|
            7\d
          )\d{7}|
          [1-7]\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="7,8" localOnly="6"/>
        <exampleNumber>1234567</exampleNumber>
        <nationalNumberPattern>
          78[0-7]\d{4}|
          17\d{6}|
          (?:
            [12][2-68]|
            3[2358]|
            4[2-58]|
            5[2-6]|
            6[3-58]|
            7[24-6]
          )\d{5}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Adding 70 from numbers found online. -->
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>712345678</exampleNumber>
        <nationalNumberPattern>7[01378]\d{7}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Mayotte (YT) -->
    <!-- Calling code and formatting shared with 'RE' -->
    <!-- Some information at the following source, but most from collection of internet data. -->
    <!-- Verifies the fixed-line prefixes, but the mobile prefixes listed here seem out of date. -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_France -->
    <!-- http://www.comores-online.com/mwezinet/internet/262 -->
    <!-- http://www.arcep.fr/index.php?id=2137&bloc=0596&CMD=RESULTS_NUMEROTATION -->
    <territory id="YT" countryCode="262" internationalPrefix="00" nationalPrefix="0">
      <generalDesc>
        <nationalNumberPattern>
          (?:
            80|
            9\d
          )\d{7}|
          (?:
            26|
            63
          )9\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>269601234</exampleNumber>
        <nationalNumberPattern>
          269(?:
            0[0-467]|
            15|
            5[0-4]|
            6\d|
            [78]0
          )\d{4}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>639012345</exampleNumber>
        <nationalNumberPattern>
          639(?:
            0[0-79]|
            1[019]|
            [267]\d|
            3[09]|
            40|
            5[05-9]|
            9[04-79]
          )\d{4}
        </nationalNumberPattern>
      </mobile>
      <!-- Same as in France. -->
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>939801234</exampleNumber>
        <nationalNumberPattern>
          9(?:
            (?:
              39|
              47
            )8[01]|
            769\d
          )\d{4}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- South Africa (ZA) -->
    <!-- http://www.itu.int/oth/T02020000C1/en -->
    <!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_South_Africa -->
    <!-- https://www.icasa.org.za/Portals/0/Regulations/Regulations/NumberingPlanReg.pdf -->
    <territory id="ZA" countryCode="27" internationalPrefix="00" nationalPrefix="0"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8[1-4]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2,3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8[1-4]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>860</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 10-digit uan numbers. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-79]\d{8}|
          8\d{4,9}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>101234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              0330|
              4302
            )|
            52087
          )0\d{3}|
          (?:
            1[0-8]|
            2[1-378]|
            3[1-69]|
            4\d|
            5[1346-8]
          )\d{7}
        </nationalNumberPattern>
      </fixedLine>
      <!-- Based on confirmation from telecom partners, many sub ranges of 1X, 2X, 3X, 4X and
           5X - which are fixed-line as per ITU - can also be used for mobile purpose. Similarly,
           some 87X VOIP ranges are also moved here.
           Even though ITU mentions it as protected, the 9-digit 85 range is a valid mobile range
           as per Wikipedia and user reports. Also note that we are still supporting numbers
           beginning with 8 that are fewer than 9 digits since they are in prominent places
           online, even though the ITU document says numbers must be 10 digits long (including the
           national prefix). -->
      <mobile>
        <possibleLengths national="[5-9]"/>
        <exampleNumber>711234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              3492[0-25]|
              4495[0235]|
              549(?:
                20|
                5[01]
              )
            )|
            4[34]492[01]
          )\d{3}|
          8[1-4]\d{3,7}|
          (?:
            2[27]|
            47|
            54
          )4950\d{3}|
          (?:
            1(?:
              049[2-4]|
              9[12]\d\d
            )|
            (?:
              6\d|
              7[0-46-9]
            )\d{3}|
            8(?:
              5\d{3}|
              7(?:
                08[67]|
                158|
                28[5-9]|
                310
              )
            )
          )\d{4}|
          (?:
            1[6-8]|
            28|
            3[2-69]|
            4[025689]|
            5[36-8]
          )4920\d{3}|
          (?:
            12|
            [2-5]1
          )492\d{4}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <possibleLengths national="9"/>
        <exampleNumber>862345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            86[2-9]|
            9[0-2]\d
          )\d{6}
        </nationalNumberPattern>
      </premiumRate>
      <sharedCost>
        <possibleLengths national="9"/>
        <exampleNumber>860123456</exampleNumber>
        <nationalNumberPattern>860\d{6}</nationalNumberPattern>
      </sharedCost>
      <!-- 88 used to be assigned to pagers prior to a migration in 2010, where it was unassigned.
           According to an official doc from 2016, 88 is "Released" for "Future non-geographic
           services", but we don't know yet what these are, so we do not validate them. -->
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>871234567</exampleNumber>
        <nationalNumberPattern>
          87(?:
            08[0-589]|
            15[0-79]|
            28[0-4]|
            31[1-9]
          )\d{4}|
          87(?:
            [02][0-79]|
            1[0-46-9]|
            3[02-9]|
            [4-9]\d
          )\d{5}
        </nationalNumberPattern>
      </voip>
      <!-- MaxiCall numbers cost as much as national long distance, so they are classified as UAN
           numbers.
           Prefix 861 with 10 digits is added based on user report. -->
      <uan>
        <possibleLengths national="9,10"/>
        <exampleNumber>861123456</exampleNumber>
        <nationalNumberPattern>861\d{6,7}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Zambia (ZM) -->
    <!-- http://www.itu.int/oth/T02020000E8/en -->
    <!-- https://www.zicta.zm/Downloads/Numbering%20Plan.pdf (2014, possibly out of date) -->
    <territory id="ZM" countryCode="260" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>[1-9]</leadingDigits>
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
        </numberFormat>
        <!-- Format for geographic fixed-line numbers and other non-mobile ranges. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[28]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Format for mobile numbers. -->
        <numberFormat pattern="(\d{2})(\d{7})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[79]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          800\d{6}|
          (?:
            21|
            63|
            [79]\d
          )\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Zambia has deprecated the "intra-network" dialling system as described in
           https://www.zicta.zm/Downloads/Numbering%20Plan.pdf (section 2.2.3). This means that
           local numbers can only be 6 digits long (and not 6 or 7 as previously modelled).
           This information was provided directly by a contact in Zambia. -->
      <fixedLine>
        <possibleLengths national="9" localOnly="6"/>
        <exampleNumber>211234567</exampleNumber>
        <nationalNumberPattern>21[1-8]\d{6}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>955123456</exampleNumber>
        <nationalNumberPattern>
          (?:
            7[5-79]|
            9[5-8]
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <voip>
        <possibleLengths national="9"/>
        <exampleNumber>630123456</exampleNumber>
        <nationalNumberPattern>63\d{7}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Zimbabwe (ZW) -->
    <!-- http://www.itu.int/oth/T02020000E9/en -->
    <!-- https://telone.co.zw/sites/default/files/TelOneNewAreaCodesUpdated.pdf -->
    <territory id="ZW" countryCode="263" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <!-- Three-digit area codes (short format) -->
        <numberFormat pattern="(\d{3})(\d{3,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            2(?:
              0[45]|
              2[278]|
              [49]8
            )|
            3(?:
              [09]8|
              17
            )|
            6(?:
              [29]8|
              37|
              75
            )|
            [23][78]|
            (?:
              33|
              5[15]|
              6[68]
            )[78]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- One-digit area codes -->
        <numberFormat pattern="(\d)(\d{3})(\d{2,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[49]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Tollfree Numbers -->
        <numberFormat pattern="(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>80</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Format of new fixed-line ranges after renumbering. -->
        <numberFormat pattern="(\d{2})(\d{7})" nationalPrefixFormattingRule="($NP$FG)">
          <leadingDigits>
            24|
            8[13-59]|
            (?:
              2[05-79]|
              39|
              5[45]|
              6[15-8]
            )2
          </leadingDigits>
          <leadingDigits>
            2(?:
              02[014]|
              4|
              [56]20|
              [79]2
            )|
            392|
            5(?:
              42|
              525
            )|
            6(?:
              [16-8]21|
              52[013]
            )|
            8[13-59]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Mobile numbers -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Three-digit area codes (long format) -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            2(?:
              1[39]|
              2[0157]|
              [378]|
              [56][14]
            )|
            3(?:
              12|
              29
            )
          </leadingDigits>
          <leadingDigits>
            2(?:
              1[39]|
              2[0157]|
              [378]|
              [56][14]
            )|
            3(?:
              123|
              29
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- VOIP numbers -->
        <numberFormat pattern="(\d{4})(\d{6})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Two-digit area codes (short format) -->
        <numberFormat pattern="(\d{2})(\d{3,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            1|
            2(?:
              0[0-36-9]|
              12|
              29|
              [56]
            )|
            3(?:
              1[0-689]|
              [24-6]
            )|
            5(?:
              [0236-9]|
              1[2-4]
            )|
            6(?:
              [013-59]|
              7[0-46-9]
            )|
            (?:
              33|
              55|
              6[68]
            )[0-69]|
            (?:
              29|
              3[09]|
              62
            )[0-79]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Two-digit area codes (long format) -->
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            29[013-9]|
            39|
            54
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Four-digit area codes (short format) -->
        <numberFormat pattern="(\d{4})(\d{3,5})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>
            (?:
              25|
              54
            )8
          </leadingDigits>
          <leadingDigits>
            258|
            5483
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          2(?:
            [0-57-9]\d{6,8}|
            6[0-24-9]\d{6,7}
          )|
          [38]\d{9}|
          [35-8]\d{8}|
          [3-6]\d{7}|
          [1-689]\d{6}|
          [1-3569]\d{5}|
          [1356]\d{4}
        </nationalNumberPattern>
      </generalDesc>
      <!-- The first block has the new renumbering format <New_Area_Code>+<New_Prefix>+<SN>. We are
           not aware of the tranisition period yet, so supporting both formats until further
           notice. These new numbers are 3 to 6 digit granularity as per telone.co.zw but for
           maintainability we are storing 4 digits. -->
      <!-- Old fixed-line ranges are grouped by subscriber-number length. -->
      <!-- The new organisation is used for both formatting and validation
           1. First we have 3 digit area code with SN(3,4,5).
           2. Then we have 3 digit area code with SN(6,7).
           3. Then we have 2 digit area code with SN(3,4,5).
           4. Then we have 2 digit area code with SN(6,7).
           5. Then we have 4 digit area code.
           6. Then we have 1 digit area code with SN(6,7). -->
      <fixedLine>
        <possibleLengths national="[5-10]" localOnly="3,4"/>
        <exampleNumber>1312345</exampleNumber>
        <nationalNumberPattern>
          (?:
            1(?:
              (?:
                3\d|
                9
              )\d|
              [4-8]
            )|
            2(?:
              (?:
                (?:
                  0(?:
                    2[014]|
                    5
                  )|
                  (?:
                    2[0157]|
                    31|
                    84|
                    9
                  )\d\d|
                  [56](?:
                    [14]\d\d|
                    20
                  )|
                  7(?:
                    [089]|
                    2[03]|
                    [35]\d\d
                  )
                )\d|
                4(?:
                  2\d\d|
                  8
                )
              )\d|
              1(?:
                2|
                [39]\d{4}
              )
            )|
            3(?:
              (?:
                123|
                (?:
                  29\d|
                  92
                )\d
              )\d\d|
              7(?:
                [19]|
                [56]\d
              )
            )|
            5(?:
              0|
              1[2-478]|
              26|
              [37]2|
              4(?:
                2\d{3}|
                83
              )|
              5(?:
                25\d\d|
                [78]
              )|
              [689]\d
            )|
            6(?:
              (?:
                [16-8]21|
                28|
                52[013]
              )\d\d|
              [39]
            )|
            8(?:
              [1349]28|
              523
            )\d\d
          )\d{3}|
          (?:
            4\d\d|
            9[2-9]
          )\d{4,5}|
          (?:
            (?:
              2(?:
                (?:
                  (?:
                    0|
                    8[146]
                  )\d|
                  7[1-7]
                )\d|
                2(?:
                  [278]\d|
                  92
                )|
                58(?:
                  2\d|
                  3
                )
              )|
              3(?:
                [26]|
                9\d{3}
              )|
              5(?:
                4\d|
                5
              )\d\d
            )\d|
            6(?:
              (?:
                (?:
                  [0-246]|
                  [78]\d
                )\d|
                37
              )\d|
              5[2-8]
            )
          )\d\d|
          (?:
            2(?:
              [569]\d|
              8[2-57-9]
            )|
            3(?:
              [013-59]\d|
              8[37]
            )|
            6[89]8
          )\d{3}
        </nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>712345678</exampleNumber>
        <nationalNumberPattern>
          7(?:
            [178]\d|
            3[1-9]
          )\d{6}
        </nationalNumberPattern>
      </mobile>
      <tollFree>
        <possibleLengths national="7"/>
        <exampleNumber>8001234</exampleNumber>
        <nationalNumberPattern>
          80(?:
            [01]\d|
            20|
            8[0-8]
          )\d{3}
        </nationalNumberPattern>
      </tollFree>
      <!-- No premiumRate information can be found. -->
      <voip>
        <possibleLengths national="10"/>
        <exampleNumber>8686123456</exampleNumber>
        <nationalNumberPattern>
          86(?:
            1[12]|
            22|
            30|
            44|
            55|
            77|
            8[368]
          )\d{6}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- Universal International Toll Free Number -->
    <!-- http://www.itu.int/en/ITU-T/inr/unum/Pages/uifn.aspx -->
    <territory id="001" countryCode="800">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>\d</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            00|
            [1-9]\d
          )\d{6}
        </nationalNumberPattern>
      </generalDesc>
      <!-- SN number starting with '00' is added based on number mentioned in
           https://www.lectra.com/en/contact and it is diallable from France (Orange network)
           https://www.bio-rad.com/contact-us?field_custom_metadata_country=39&field_custom_metadata_vertical_code=All (country = France) -->
      <tollFree>
        <possibleLengths national="8"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>
          (?:
            00|
            [1-9]\d
          )\d{6}
        </nationalNumberPattern>
      </tollFree>
    </territory>

    <!-- Universal International Shared Cost Number -->
    <!-- http://www.itu.int/rec/T-REC-E.169-200205-I/en -->
    <territory id="001" countryCode="808">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[1-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{7}</nationalNumberPattern>
      </generalDesc>
      <sharedCost>
        <possibleLengths national="8"/>
        <exampleNumber>12345678</exampleNumber>
        <nationalNumberPattern>[1-9]\d{7}</nationalNumberPattern>
      </sharedCost>
    </territory>

    <!-- Inmarsat Global Limited -->
    <!-- http://www.itu.int/oth/T0202000065/en -->
    <!-- http://www.inmarsat.com -->
    <territory id="001" countryCode="870">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>[35-7]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          7\d{11}|
          [35-7]\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <!-- Assigning these to mobile since Inmarsat considers them to be mobile numbers. -->
      <mobile>
        <possibleLengths national="9,12"/>
        <exampleNumber>301234567</exampleNumber>
        <nationalNumberPattern>
          (?:
            [356]|
            774[45]
          )\d{8}|
          7[6-8]\d{7}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- VISIONng -->
    <!-- Number length has been derived from examples found online. -->
    <!-- http://www.itu.int/oth/T02020000E5/en -->
    <territory id="001" countryCode="878">
      <availableFormats>
        <!-- Formatting chosen based on online examples. -->
        <numberFormat pattern="(\d{2})(\d{5})(\d{5})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>10\d{10}</nationalNumberPattern>
      </generalDesc>
      <voip>
        <possibleLengths national="12"/>
        <exampleNumber>101234567890</exampleNumber>
        <nationalNumberPattern>10\d{10}</nationalNumberPattern>
      </voip>
    </territory>

    <!-- Iridium -->
    <!-- Globalstar also reports using this prefix, but we cannot find any online numbers with the
         Globalstar prefixes, so are not sure how exactly these work, and what length the numbers
         are. For this reason, we only support Iridium numbers at the moment. -->
    <!-- http://www.iridium.com -->
    <!-- http://www.itu.int/oth/T0202000069/en -->
    <territory id="001" countryCode="881">
      <availableFormats>
        <!-- Formatting chosen based on ITU document and Iridium website FAQ. -->
        <numberFormat pattern="(\d)(\d{3})(\d{5})">
          <leadingDigits>[0-37-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{5,6})">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          6\d{9}|
          [0-36-9]\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <mobile>
        <possibleLengths national="9,10"/>
        <exampleNumber>612345678</exampleNumber>
        <nationalNumberPattern>
          6\d{9}|
          [0-36-9]\d{8}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- List of all international satellite number prefixes. -->
    <!-- BebbiCell (Formerly Global Networks Switzerland AG) +88234 -->
    <!-- Maritime Communications Partner (MCP) +88232 -->
    <!-- Oration Technologies +88237 -->
    <!-- Telespazio S.p.A. +88213 -->
    <!-- Thuraya +88216 -->
    <!-- https://www.itu.int/net/itu-t/inrdb/e164_intlsharedcc.aspx?cc=-1 -->
    <!-- http://www.itu.int/oth/T0202000054/en -->
    <!-- http://www.gsm.aq/numberplan.php -->
    <!-- http://www.global.aq -->
    <!-- http://www.itu.int/oth/T02020000F4/en -->
    <!-- http://www.itu.int/oth/T02020000A0/en -->
    <!-- http://www.itu.int/oth/T02020000CC/en -->
    <!-- http://www.itu.int/oth/T02020000CF/en -->
    <territory id="001" countryCode="882">
      <availableFormats>
        <!-- For 7 digit numbers in general -->
        <numberFormat pattern="(\d{2})(\d{5})">
          <leadingDigits>
            16|
            342
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- For 8 digit mobile numbers. -->
        <numberFormat pattern="(\d{2})(\d{6})">
          <leadingDigits>49</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- For 8 digit VOIP numbers. -->
        <numberFormat pattern="(\d{2})(\d{2})(\d{4})">
          <leadingDigits>
            1[36]|
            9
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 9 digit mobile numbers. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{3})">
          <leadingDigits>3[23]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 9 and 10 digit VOIP numbers. -->
        <numberFormat pattern="(\d{2})(\d{3,4})(\d{4})">
          <leadingDigits>16</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 10 digit numbers in general. -->
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>
            10|
            23|
            3(?:
              [15]|
              4[57]
            )|
            4|
            51
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For voice mail numbers. -->
        <numberFormat pattern="(\d{3})(\d{4})(\d{4})">
          <leadingDigits>34</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- For 11 and 12 digit numbers except voice mail. -->
        <numberFormat pattern="(\d{2})(\d{4,5})(\d{5})">
          <leadingDigits>[1-35]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [13]\d{6}(?:
            \d{2,5}
          )?|
          [19]\d{7}|
          (?:
            [25]\d\d|
            4
          )\d{7}(?:
            \d{2}
          )?
        </nationalNumberPattern>
      </generalDesc>
      <!-- Bebbicell Mobile numbers, MCP and Oration. We are guessing the number length for
           Oration based on numbers found online. AT&T have confirmed that 37X numbers
           are 12 digit MSISDN numbers. -->
      <mobile>
        <possibleLengths national="[7-10],12"/>
        <exampleNumber>3421234</exampleNumber>
        <nationalNumberPattern>
          342\d{4}|
          (?:
            337|
            49
          )\d{6}|
          (?:
            3(?:
              2|
              47|
              7\d{3}
            )|
            50\d{3}
          )\d{7}
        </nationalNumberPattern>
      </mobile>
      <!-- Telespazio S.p.A., Thuraya and Bebbicell VOIP numbers. -->
      <!-- Added Vodafone's satellite range +882 39 here. Length and type are based on user-
           reported issue as there are no numbers found online. -->
      <voip>
        <possibleLengths national="[7-12]"/>
        <exampleNumber>390123456789</exampleNumber>
        <nationalNumberPattern>
          1(?:
            3(?:
              0[0347]|
              [13][0139]|
              2[035]|
              4[013568]|
              6[0459]|
              7[06]|
              8[15-8]|
              9[0689]
            )\d{4}|
            6\d{5,10}
          )|
          (?:
            345\d|
            9[89]
          )\d{6}|
          (?:
            10|
            2(?:
              3|
              85\d
            )|
            3(?:
              [15]|
              [69]\d\d
            )|
            4[15-8]|
            51
          )\d{8}
        </nationalNumberPattern>
      </voip>
      <voicemail>
        <possibleLengths national="11"/>
        <exampleNumber>34851234567</exampleNumber>
        <nationalNumberPattern>348[57]\d{7}</nationalNumberPattern>
      </voicemail>
    </territory>

    <!-- bandwidth.com -->
    <!-- SipMe -->
    <!-- Voxbone -->
    <!-- http://www.itu.int/oth/T02020000FB/en -->
    <!-- http://www.itu.int/oth/T02020000FC/en -->
    <!-- http://www.itu.int/oth/T02020000F3/en -->
    <territory id="001" countryCode="883">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{2,8})">
          <leadingDigits>
            [14]|
            2[24-689]|
            3[02-689]|
            51[24-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>510</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>21</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- When only 8 digits follow the area code formatting as XXXX XXXX
             seems preferred (see Bandwidth.com and SipMe) -->
        <numberFormat pattern="(\d{4})(\d{4})(\d{4})">
          <leadingDigits>51[13]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{3})">
          <leadingDigits>[235]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            [1-4]\d|
            51
          )\d{6,10}
        </nationalNumberPattern>
      </generalDesc>
      <voip>
        <possibleLengths national="[8-12]"/>
        <exampleNumber>510012345</exampleNumber>
        <nationalNumberPattern>
          (?:
            2(?:
              00\d\d|
              10
            )|
            (?:
              370[1-9]|
              51\d0
            )\d
          )\d{7}|
          51(?:
            00\d{5}|
            [24-9]0\d{4,7}
          )|
          (?:
            1[0-79]|
            2[24-689]|
            3[02-689]|
            4[0-4]
          )0\d{5,9}
        </nationalNumberPattern>
      </voip>
    </territory>

    <!-- United Nations- OCHA -->
    <!-- Numbers here are classified as UAN, as they are non-geographical and universally
         accessible. In addition, the end-user tariff to reach these numbers is lower or similar to
         the tariff of a national call. -->
    <!-- http://www.itu.int/oth/T02020000FA/en -->
    <territory id="001" countryCode="888">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{5})">
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>\d{11}</nationalNumberPattern>
      </generalDesc>
      <uan>
        <possibleLengths national="11"/>
        <exampleNumber>12345678901</exampleNumber>
        <nationalNumberPattern>\d{11}</nationalNumberPattern>
      </uan>
    </territory>

    <!-- Universal International Premium Rate Number -->
    <!-- http://www.itu.int/rec/T-REC-E.169-200205-I/en -->
    <territory id="001" countryCode="979">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <leadingDigits>[1359]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1359]\d{8}</nationalNumberPattern>
      </generalDesc>
      <premiumRate>
        <possibleLengths national="9" localOnly="8"/>
        <exampleNumber>123456789</exampleNumber>
        <nationalNumberPattern>[1359]\d{8}</nationalNumberPattern>
      </premiumRate>
    </territory>

  </territories>
</phoneNumberMetadata>