<!-- 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. This file is used
     solely for the purpose of unittesting, so data in this file is not
     necessarily consistent with that of PhoneNumberMetadata.xml.
-->

<phoneNumberMetadata>
  <territories>
    <!-- Andorra -->
    <territory id="AD" countryCode="376" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>\d{6}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>\d{6}</nationalNumberPattern>
        <possibleLengths national="6"/>
        <exampleNumber>123456</exampleNumber>
      </fixedLine>
    </territory>

    <!-- United Arab Emirates -->
    <!-- Added since when formatting the number for mobile dialling we have special rules to handle
         it. -->
    <territory id="AE" countryCode="971" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <uan>
        <nationalNumberPattern>600\d{6}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>600123456</exampleNumber>
      </uan>
    </territory>

    <!-- Armenia -->
    <!-- Added to test same mobile and fixed-line in custom builds. -->
    <territory id="AM" countryCode="374" internationalPrefix="00"
               nationalPrefix="0">
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{7}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[1-9]\d{7}</nationalNumberPattern>
        <possibleLengths national="8" localOnly="5,6"/>
        <exampleNumber>10123456</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>[1-9]\d{7}</nationalNumberPattern>
        <possibleLengths national="8" localOnly="5,6"/>
        <exampleNumber>10123456</exampleNumber>
      </mobile>
    </territory>

    <!-- Angola -->
    <!-- This country has been coopted to test the case of a national prefix with a non-numeric
         symbol in it. It is also useful since it has no national prefix formatting rule. -->
    <territory id="AO" countryCode="244" internationalPrefix="00" nationalPrefix="0~0">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[29]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>2\d(?:[26-9]\d|\d[26-9])\d{5}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>222123456</exampleNumber>
      </fixedLine>
      <mobile>
        <!-- Expanded the 92 prefix possibilities to match numbers found online. -->
        <nationalNumberPattern>9[1-3]\d{7}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>923123456</exampleNumber>
      </mobile>
    </territory>

    <!-- Argentina -->
    <territory id="AR" countryCode="54" internationalPrefix="00"
               nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"
               nationalPrefixForParsing="0(?:(11|343|3715)15)?"
               nationalPrefixTransformRule="9$1">
      <!-- Note in nationalPrefixForParsing, the areacode (such as 11, 343, etc.), when present in
           front of carrier selection code 15, is captured to replace $1 in
           nationalPrefixTransformRule -->
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>11</leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{4})">
          <leadingDigits>1[02-9]|[23]</leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{2})(\d{4})(\d{4})">
          <leadingDigits>911</leadingDigits>
          <format>$2 15 $3-$4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{2})(\d{4})"
          carrierCodeFormattingRule="$NP$FG $CC">
          <leadingDigits>9(?:1[02-9]|[23])</leadingDigits>
          <format>$2 $3-$4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>[68]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-3689]\d{9,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[1-3]\d{5,9}</nationalNumberPattern>
        <possibleLengths national="[6-10]"/>
        <exampleNumber>1234567890</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>9\d{10}|[1-3]\d{9}</nationalNumberPattern>
        <possibleLengths national="10,11"/>
        <exampleNumber>9234567890</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8034567890</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>6(0\d|10)\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>6234567890</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Australia -->
    <!-- Country calling code shared with Cocos Islands (CC) and Christmas Islands (CX) -->
    <territory id="AU" countryCode="61" internationalPrefix="001[12]"
               nationalPrefix="0" preferredInternationalPrefix="0011"
               nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat nationalPrefixFormattingRule="$FG"
          pattern="(\d{4})(\d{3})(\d{3})" >
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <leadingDigits>[2-478]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc >
        <nationalNumberPattern>[1-578]\d{4,14}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[2378]\d{8}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>212345678</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>4\d{8}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>412345678</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>1800\d{6}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>1800123456</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>190[0126]\d{6}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>1900123456</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Barbados -->
    <territory id="BB" countryCode="1" internationalPrefix="011">
      <generalDesc>
        <nationalNumberPattern>246\d{7}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2464567890</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Brazil -->
    <!-- This country is used to test ShortNumberInfo, so at least the country calling code must be
         recognised by the library. It is also used for formatInOriginalFormat tests, so some length
         metadata is needed. -->
    <territory id="BR" countryCode="55" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>\d{8,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>\d{8,10}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="8"/>
        <exampleNumber>12345678</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Bahamas -->
    <territory id="BS" countryCode="1" internationalPrefix="011"
               nationalPrefix="1">
      <generalDesc>
        <nationalNumberPattern>(242|8(00|66|77|88)|900)\d{7}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>
          242(?:
            3(?:
              02|
              [236][1-9]|
              4[0-24-9]|
              5[0-68]|
              7[3-57]|
              9[2-5]
            )|
            4(?:
              2[237]|
              51|
              64|
              77
            )|
            502|
            636|
            702
          )\d{4}
        </nationalNumberPattern>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2425027890</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>242(357|359|457|557)\d{4}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>2423577890</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>8(00|66|77|88)\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Belarus -->
    <!-- This country has been coopted to test the case of a national prefix formatting rule with a
         space in it and the case where a number happens to begin with the national prefix, but
         would become too short if the prefix is stripped. -->
    <territory id="BY" countryCode="375" internationalPrefix="810" nationalPrefix="8"
               nationalPrefixForParsing="80?|99999" nationalPrefixFormattingRule="$NP $FG">
      <availableFormats>
        <!-- We make some bogus formatting templates that differ only in length to check that
             switching formatting patterns works as expected.-->
        <numberFormat pattern="(\d{4})">
          <leadingDigits>[1-8]</leadingDigits>
          <format>$1</format>
        </numberFormat>
        <!-- This pattern has an override to remove the space after the national prefix. -->
        <numberFormat pattern="(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG">
          <leadingDigits>[1-8]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})">
          <leadingDigits>[1-8]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <!-- This numbering plan is completely bogus, but is used to test the AYTF logic. For that
             reason, it is kept very simple. -->
        <nationalNumberPattern>[1-9]\d{5}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[1-9]\d{5}</nationalNumberPattern>
        <possibleLengths national="6"/>
        <exampleNumber>112345</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Canada -->
    <territory id="CA" countryCode="1" internationalPrefix="011">
      <generalDesc>
        <nationalNumberPattern>226\d{7}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>226\d{7}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2261234567</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Cocos Islands -->
    <!-- Country calling code shared with Australia. -->
    <!-- This country is used to test ShortNumberInfo, so at least the country calling code must be
         recognised by the library, and some length information is needed for parsing. -->
    <territory id="CC" countryCode="61" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>\d{6,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>\d{6,10}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="6"/>
        <exampleNumber>2261234567</exampleNumber>
      </fixedLine>
    </territory>

    <!-- China -->
    <!-- Used to test as-you-type-formatter with complicated number format patterns. Also used to
         test that not all geographical mobile numbers have an area code. -->
    <territory id="CN" countryCode="86" internationalPrefix="00" nationalPrefix="0">
      <availableFormats>
        <numberFormat nationalPrefixFormattingRule="$NP$FG" pattern="(\d{3})(\d{5,6})"
                      carrierCodeFormattingRule="$CC $FG">
          <leadingDigits>[3-9]</leadingDigits>
          <leadingDigits>[3-9]\d{2}[19]</leadingDigits>
          <leadingDigits>
            [3-9]\d{2}(?:
              10|
              95
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <!-- Note that mobile numbers do not get formatted with the national prefix. -->
        <numberFormat nationalPrefixFormattingRule="$FG" pattern="(\d{3})(\d{8})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [1-7]\d{6,11}|
          8[0-357-9]\d{6,9}|
          9\d{7,10}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[2-9]\d{10}</nationalNumberPattern>
        <possibleLengths national="11"/>
        <exampleNumber>91234567</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>
          1(?:
            [38]\d|
            4[57]|
            5[0-35-9]|
            7[0136-8]
          )\d{8}
        </nationalNumberPattern>
        <possibleLengths national="11"/>
        <exampleNumber>13123456789</exampleNumber>
      </mobile>
    </territory>

    <!-- Colombia (CO) -->
    <!-- Data is here to check formatForMobileDialling() API is no more considering CO as special
         i.e it returns regular E.164 format rather than using the 03 carrier code. -->
    <territory id="CO" countryCode="57" nationalPrefix="0"
               nationalPrefixForParsing="0(4(?:[14]4|56)|[579])?" 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</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          (?:
            60|
            3\d
          )\d{8}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10"/>
        <exampleNumber>6012345678</exampleNumber>
        <nationalNumberPattern>60\d{8}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>3211234567</exampleNumber>
        <nationalNumberPattern>
          3(?:
            0[0-5]|
            1\d|
            2[0-3]|
            5[01]|
            70
          )\d{7}
        </nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Christmas Islands -->
    <!-- Country calling code shared with Australia. -->
    <!-- This country is used to test ShortNumberInfo, so at least the country calling code must be
         recognised by the library, and some length information is needed for parsing. -->
    <territory id="CX" countryCode="61" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>\d{8,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>\d{8,10}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="8"/>
        <exampleNumber>2261234567</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Germany -->
    <territory id="DE" countryCode="49" internationalPrefix="00"
               nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3,8})">
          <leadingDigits>2|3[3-9]|906|[4-9][1-9]1</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4,11})">
          <leadingDigits>[34]0|[68]9</leadingDigits>
          <format>$1/$2</format>
        </numberFormat>
        <!-- Extra fictional pattern for shorter numbers with the same prefixes as the following
             pattern, to illustrate the problem the AYTF has with real patterns that share this
             property. -->
        <numberFormat pattern="(\d{2})(\d{2})">
          <leadingDigits>[4-9]</leadingDigits>
          <leadingDigits>[4-6]|[7-9](?:\d[1-9]|[1-9]\d)</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2,7})">
          <leadingDigits>[4-9]</leadingDigits>
          <leadingDigits>[4-6]|[7-9](?:\d[1-9]|[1-9]\d)</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{1})(\d{6})">
          <leadingDigits>800</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3,4})(\d{4})">
          <leadingDigits>900</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>\d{4,14}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>
          (?:
            [24-6]\d{2}|
            3[03-9]\d|
            [789](?:
              0[2-9]|
              [1-9]\d
            )
          )\d{1,8}
        </nationalNumberPattern>
        <possibleLengths national="[4-11]" localOnly="2,3"/>
        <exampleNumber>30123456</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1(5\d{9}|7\d{8}|6[02]\d{8}|63\d{7})</nationalNumberPattern>
        <possibleLengths national="10,11"/>
        <exampleNumber>15123456789</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900([135]\d{6}|9\d{7})</nationalNumberPattern>
        <possibleLengths national="10,11"/>
        <exampleNumber>9001234567</exampleNumber>
      </premiumRate>
    </territory>

    <!-- France -->
    <territory id="FR" countryCode="33" nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"
               internationalPrefix="00">
      <availableFormats>
        <!-- We use this to test the phone number matcher. For our test-case, the formatting
             pattern must have as the first group a sub-part of the country calling code,
             and have a national prefix. This corresponds to the test number +33 3 34 2312. -->
        <numberFormat pattern="(\d)(\d{2})(\d{2})(\d{2})">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>3\d{6}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>3\d{6}</nationalNumberPattern>
        <possibleLengths national="7"/>
        <exampleNumber>3123456</exampleNumber>
      </fixedLine>
    </territory>

    <!-- United Kingdom -->
    <territory id="GB" countryCode="44" internationalPrefix="00"
               nationalPrefix="0" nationalPrefixFormattingRule="($NP$FG)"
               mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>[1-59]|[78]0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{3})">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>7[1-57-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>8[47]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>\d{10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[1-6]\d{9}</nationalNumberPattern>
        <possibleLengths national="9,10" localOnly="6,7,8"/>
        <exampleNumber>3123456789</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>7[1-57-9]\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>7123456789</exampleNumber>
      </mobile>
      <pager>
        <nationalNumberPattern>76\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>7623456789</exampleNumber>
      </pager>
      <tollFree>
        <nationalNumberPattern>80\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8023456789</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>9[018]\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>9023456789</exampleNumber>
      </premiumRate>
      <sharedCost>
        <nationalNumberPattern>8(?:4[3-5]|7[0-2])\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8433456789</exampleNumber>
      </sharedCost>
      <voip>
        <nationalNumberPattern>56\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>5633456789</exampleNumber>
      </voip>
      <personalNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>7033456789</exampleNumber>
      </personalNumber>
    </territory>

    <!-- Guernsey -->
    <!-- This country is used to test ShortNumberInfo, so at least the country calling code must be
         recognised by the library, and it must be the same as that of the United Kingdom. -->
    <territory id="GG" countryCode="44" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>\d{6,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>\d{6,10}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="6"/>
        <exampleNumber>7033456789</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Italy -->
    <!-- http://en.wikipedia.org/wiki/%2B39 -->
    <territory id="IT" countryCode="39" internationalPrefix="00">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>0[26]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})(\d{3,4})">
          <leadingDigits>0[13-57-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})">
          <leadingDigits>3</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3,6})">
          <leadingDigits>8</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[0389]\d{5,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>0\d{9,10}</nationalNumberPattern>
        <possibleLengths national="10,11"/>
        <exampleNumber>0123456789</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>3\d{8,9}</nationalNumberPattern>
        <possibleLengths national="9,10"/>
        <exampleNumber>3123456789</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80(?:0\d{6}|3\d{3})</nationalNumberPattern>
        <possibleLengths national="6,9"/>
        <exampleNumber>800123456</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>89(?:2\d{3}|9\d{6})</nationalNumberPattern>
        <possibleLengths national="6,9"/>
        <exampleNumber>892123</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Japan -->
    <!-- The metadata here is added to unit test AsYouTypeFormatter for JP, which requires switching
         patterns as digits beyond the third one are entered. As a result, only a few fake
         formatting rules are added. -->
    <territory id="JP" countryCode="81" internationalPrefix="010"
               nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>[57-9]0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})(\d{4})">
          <leadingDigits>[57-9]0</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>111|222|333</leadingDigits>
          <leadingDigits>(?:111|222|333)1</leadingDigits>
          <leadingDigits>(?:111|222|333)11</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d)(\d{4})">
          <leadingDigits>222|333</leadingDigits>
          <leadingDigits>2221|3332</leadingDigits>
          <leadingDigits>22212|3332</leadingDigits>
          <leadingDigits>222120|3332</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})">
          <leadingDigits>[23]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})">
          <leadingDigits>077</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <!-- The following numberFormat is added to test that the format containing the star sign is
             not used by the AYTF. -->
        <numberFormat nationalPrefixFormattingRule="$FG" pattern="(\d{4})">
          <leadingDigits>[23]</leadingDigits>
          <format>*$1</format>
        </numberFormat>
      </availableFormats>
      <noInternationalDialling>
        <nationalNumberPattern>[23]\d{3}</nationalNumberPattern>
        <possibleLengths national="4"/>
        <exampleNumber>2123</exampleNumber>
      </noInternationalDialling>
      <generalDesc>
        <nationalNumberPattern>07\d{5}|[1-357-9]\d{3,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>07\d{5}|[1-357-9]\d{3,10}</nationalNumberPattern>
        <possibleLengths national="[4-11]"/>
        <exampleNumber>0712345</exampleNumber>
      </fixedLine>
      <tollFree>
        <nationalNumberPattern>0777[01]\d{2}</nationalNumberPattern>
        <possibleLengths national="7"/>
        <exampleNumber>0777012</exampleNumber>
      </tollFree>
    </territory>

    <!-- Korea (Rep. of) -->
    <!-- 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 -->
    <!-- Exceptions :
        internationalPrefix
            0031, 0033, 0071, 0073 - Special services of KT and DACOM, ignorable
        nationalPrefix
            1[4-6]XX-YYYY - Country-wide common number services, display as it is without hyphens -->
    <territory id="KR" countryCode="82" internationalPrefix="00(?:[124-68]|[37]\d{2})"
               nationalPrefix="0" nationalPrefixForParsing="0(8[1-46-8]|85\d{2})?"
               nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>1(?:0|1[19]|[69]9|5[458])|[57]0</leadingDigits>
          <leadingDigits>1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][2-9]</leadingDigits>
          <leadingDigits>1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][2-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d)(\d{4})">
          <leadingDigits>131</leadingDigits>
          <leadingDigits>1312</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})">
          <leadingDigits>131</leadingDigits>
          <leadingDigits>131[13-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>13[2-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})(\d{4})">
          <leadingDigits>30</leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <leadingDigits>2(?:[26]|3[0-467])</leadingDigits>
          <leadingDigits>2(?:[26]|3(?:01|1[45]|2[17-9]|39|4|6[67]|7[078]))</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4})">
          <leadingDigits>2(?:3[0-35-9]|[457-9])</leadingDigits>
          <leadingDigits>2(?:3(?:0[02-9]|1[0-36-9]|2[02-6]|3[0-8]|6[0-589]|7[1-69]|[589])|[457-9])</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})">
          <leadingDigits>21[0-46-9]</leadingDigits>
          <leadingDigits>21(?:[0-247-9]|3[124]|6[1269])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})">
          <leadingDigits>21[36]</leadingDigits>
          <leadingDigits>21(?:3[035-9]|6[03-578])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})">
          <leadingDigits>[3-6][1-9]1</leadingDigits>
          <leadingDigits>[3-6][1-9]1(?:[0-46-9])</leadingDigits>
          <leadingDigits>[3-6][1-9]1(?:[0-247-9]|3[124]|6[1269])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})">
          <leadingDigits>[3-6][1-9]1</leadingDigits>
          <leadingDigits>[3-6][1-9]1[36]</leadingDigits>
          <leadingDigits>[3-6][1-9]1(?:3[035-9]|6[03-578])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-7]\d{3,9}|8\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\d{2,3}|[2-9]\d{6,7})</nationalNumberPattern>
        <possibleLengths national="[4-10]"/>
        <exampleNumber>22123456</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1[0-25-9]\d{7,8}</nationalNumberPattern>
        <possibleLengths national="9,10"/>
        <exampleNumber>1023456789</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>60[2-9]\d{6}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>602345678</exampleNumber>
      </premiumRate>
      <personalNumber>
        <nationalNumberPattern>50\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>5012345678</exampleNumber>
      </personalNumber>
      <voip>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>7012345678</exampleNumber>
      </voip>
    </territory>

    <!-- Mexico -->
    <territory id="MX" countryCode="52" internationalPrefix="00"
               nationalPrefix="01" nationalPrefixForParsing="01|04[45](\d{10})"
               nationalPrefixTransformRule="1$1" nationalPrefixFormattingRule="$NP $FG"
               nationalPrefixOptionalWhenFormatting="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>[89]00</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- This formatting pattern is added to test that the AYTF should return unformatted
             results when the first group is dropped in the output. -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{5})">
          <leadingDigits>901</leadingDigits>
          <format>$2 $3</format>
          <intlFormat>$2 $3</intlFormat>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>33|55|81</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>[2467]|3[0-24-9]|5[0-46-9]|8[2-9]|9[1-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat nationalPrefixFormattingRule="$FG" pattern="(\d)(\d{2})(\d{4})(\d{4})">
          <leadingDigits>1(?:33|55|81)</leadingDigits>
          <format>045 $2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <numberFormat nationalPrefixFormattingRule="$FG" pattern="(\d)(\d{3})(\d{3})(\d{4})">
          <leadingDigits>1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])</leadingDigits>
          <format>045 $2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{9,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[2-9]\d{9}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>2123456789</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1\d{10}</nationalNumberPattern>
        <possibleLengths national="11"/>
        <exampleNumber>11234567890</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8001234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>9001234567</exampleNumber>
      </premiumRate>
    </territory>

    <!-- New Zealand -->
    <territory id="NZ" countryCode="64" internationalPrefix="00"
               nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{4})">
          <leadingDigits>24|[34679]</leadingDigits>
          <format>$1-$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3,5})">
          <leadingDigits>2[179]</leadingDigits>
          <format>$1-$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})">
          <leadingDigits>[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>
          [289]\d{7,9}|
          [3-7]\d{7}
        </nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>24099\d{3}|(?:3[2-79]|[479][2-689]|6[235-9])\d{6}</nationalNumberPattern>
        <possibleLengths national="7,8"/>
        <exampleNumber>24099123</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>2(?:[027]\d{7}|9\d{6,7}|1(?:0\d{5,7}|[12]\d{5,6}|[3-9]\d{5})|4[1-9]\d{6}|8\d{7,8})</nationalNumberPattern>
        <possibleLengths national="[8-10]"/>
        <exampleNumber>201234567</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{6,7}</nationalNumberPattern>
        <possibleLengths national="9,10"/>
        <exampleNumber>8001234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{6,7}</nationalNumberPattern>
        <possibleLengths national="9,10"/>
        <exampleNumber>9001234567</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Poland -->
    <!-- http://en.wikipedia.org/wiki/%2B48 -->
    <territory id="PL" countryCode="48" internationalPrefix="00"
               nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})">
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <mobile>
        <nationalNumberPattern>(?:5[01]|6[069]|7[289]|88)\d{7}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>501234567</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>800123456</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>70\d{7}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>701234567</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Réunion (French Departments and Territories in the Indian Ocean) -->
    <!-- Note this shares the same country code as La Mayotte and French
    Southern Territories, and the formatting patterns here are used by all of
    them. This is present to test leadingDigits. -->
    <territory id="RE" countryCode="262" leadingDigits="262|6(?:9[23]|47)|8"
               internationalPrefix="00" nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[268]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <!-- 0876 numbers are mentioned in the plan, but none in use can be
        found. -->
        <nationalNumberPattern>262\d{6}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>262161234</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>6(?:9[23]|47)\d{6}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>692123456</exampleNumber>
      </mobile>
      <!-- 08* Numbers in Réunion are the same as those valid in France. -->
      <tollFree>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>8(?:1[01]|2[0156]|84|9[0-37-9])\d{6}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>810123456</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Russian Federation -->
    <territory id="RU" countryCode="7" internationalPrefix="810" nationalPrefix="8"
               nationalPrefixFormattingRule="$NP ($FG)" nationalPrefixOptionalWhenFormatting="true">
      <generalDesc>
        <nationalNumberPattern>[347-9]\d{9}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="10"/>
        <exampleNumber>3011234567</exampleNumber>
        <nationalNumberPattern>[348]\d{9}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="10"/>
        <exampleNumber>9123456789</exampleNumber>
        <nationalNumberPattern>9\d{9}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Sweden -->
    <territory id="SE" countryCode="46" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>\d{9}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9"/>
        <exampleNumber>123456789</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Singapore -->
    <!-- http://www.ida.gov.sg/policies%20and%20regulation/20060508120124.aspx -->
    <!-- For testing the AYTF with long NDDs, "777777" is added as a possible national prefix. -->
    <territory id="SG" countryCode="65" internationalPrefix="0[0-3][0-9]"
               nationalPrefixForParsing="777777">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>[369]|8[1-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{4})">
          <leadingDigits>1[89]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>800</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[13689]\d{7,10}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[36]\d{7}</nationalNumberPattern>
        <possibleLengths national="8"/>
        <exampleNumber>31234567</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>[89]\d{7}</nationalNumberPattern>
        <possibleLengths national="8"/>
        <exampleNumber>81234567</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>1?800\d{7}</nationalNumberPattern>
        <possibleLengths national="10,11"/>
        <exampleNumber>8001234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>1900\d{7}</nationalNumberPattern>
        <possibleLengths national="11"/>
        <exampleNumber>19001234567</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Tristan da Cunha -->
    <!-- Added this country, which in real life has no mobile numbers, to test
         isPossibleNumberForType for the case where the fixed-line and mobile lengths are different,
         there is a hole in the middle, and the type FIXED_LINE_OR_MOBILE is passed in. Also added
         tollFree to test that this doesn't influence things. -->
    <territory id="TA" countryCode="290" internationalPrefix="00">
      <generalDesc>
        <nationalNumberPattern>8\d{3,7}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>8\d{5}</nationalNumberPattern>
        <possibleLengths national="6"/>
        <exampleNumber>812345</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>8\d{3}</nationalNumberPattern>
        <possibleLengths national="4"/>
        <exampleNumber>8123</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>8\d{7}</nationalNumberPattern>
        <possibleLengths national="8"/>
        <exampleNumber>81234567</exampleNumber>
      </tollFree>
    </territory>

    <!-- United States -->
    <!-- http://www.nanpa.com/reports/reports_npa.html -->
    <!-- For testing purposes, numbers starting with 24 are not considered US numbers.-->
    <territory id="US" countryCode="1" internationalPrefix="011"
               preferredExtnPrefix=" extn. " nationalPrefix="1"
               mainCountryForCode="true" mobileNumberPortableRegion="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{4})">
          <format>$1 $2</format>
          <intlFormat>NA</intlFormat>
       </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <!-- Numbers beginning with 7 are excluded for testing purposes only. -->
        <nationalNumberPattern>[13-689]\d{9}|2[0-35-9]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[13-689]\d{9}|2[0-35-9]\d{8}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>1234567890</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>[13-689]\d{9}|2[0-35-9]\d{8}</nationalNumberPattern>
        <possibleLengths national="10" localOnly="7"/>
        <exampleNumber>1234567890</exampleNumber>
      </mobile>
      <noInternationalDialling>
        <!-- This range is added for testing purposes only. -->
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8004567890</exampleNumber>
      </noInternationalDialling>
      <tollFree>
        <nationalNumberPattern>8(?:00|66|77|88)\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>8004567890</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
        <possibleLengths national="10"/>
        <exampleNumber>9004567890</exampleNumber>
      </premiumRate>
    </territory>

    <!-- Uzbekistan -->
    <territory id="UZ" countryCode="998" preferredInternationalPrefix="8~10"
               internationalPrefix="810" nationalPrefix="8" nationalPrefixFormattingRule="$NP $FG">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})">
          <leadingDigits>[679]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[69]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <possibleLengths national="9" localOnly="7"/>
        <exampleNumber>662345678</exampleNumber>
        <nationalNumberPattern>6122\d{5}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <possibleLengths national="9"/>
        <exampleNumber>912345678</exampleNumber>
        <nationalNumberPattern>9[0-57-9]\d{7}</nationalNumberPattern>
      </mobile>
    </territory>

    <!-- Mayotte -->
    <territory id="YT" countryCode="262" leadingDigits="269|639"
               internationalPrefix="00" nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG">
      <!-- Formatting as per La Réunion. -->
      <generalDesc>
        <nationalNumberPattern>[268]\d{8}</nationalNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>2696[0-4]\d{4}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>269601234</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>639\d{6}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>639123456</exampleNumber>
      </mobile>
      <!-- Same as in France. -->
      <tollFree>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>801234567</exampleNumber>
      </tollFree>
    </territory>

    <!-- International Toll Free numbers  -->
    <territory id="001" countryCode="800">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>\d{8}</nationalNumberPattern>
      </generalDesc>
      <tollFree>
        <nationalNumberPattern>\d{8}</nationalNumberPattern>
        <possibleLengths national="8"/>
        <exampleNumber>12345678</exampleNumber>
      </tollFree>
    </territory>

    <!-- A non-geographical entity which we declare as having no fixed-line, but some mobile
         numbers. -->
    <territory id="001" countryCode="882">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>\d{9}</nationalNumberPattern>
      </generalDesc>
      <mobile>
        <nationalNumberPattern>\d{9}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>123456789</exampleNumber>
      </mobile>
    </territory>

    <!-- Universal International Preium Rate Number -->
    <territory id="001" countryCode="979">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>\d{9}</nationalNumberPattern>
      </generalDesc>
      <premiumRate>
        <nationalNumberPattern>\d{9}</nationalNumberPattern>
        <possibleLengths national="9"/>
        <exampleNumber>123456789</exampleNumber>
      </premiumRate>
    </territory>
  </territories>
</phoneNumberMetadata>
