<!-- 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">
    </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>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </generalDesc>
      <uan>
        <nationalNumberPattern>600\d{6}</nationalNumberPattern>
        <exampleNumber>600123456</exampleNumber>
      </uan>
    </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>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>2\d(?:[26-9]\d|\d[26-9])\d{5}</nationalNumberPattern>
        <exampleNumber>222123456</exampleNumber>
      </fixedLine>
      <mobile>
        <!-- Expanded the 92 prefix possibilities to match numbers found online. -->
        <nationalNumberPattern>9[1-3]\d{7}</nationalNumberPattern>
        <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="(9)(11)(\d{4})(\d{4})">
          <leadingDigits>911</leadingDigits>
          <format>$2 15 $3-$4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <numberFormat pattern="(9)(\d{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>
        <possibleNumberPattern>\d{6,11}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
         <nationalNumberPattern>[1-3]\d{9}</nationalNumberPattern>
         <possibleNumberPattern>\d{6,10}</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>9\d{10}|[1-3]\d{9}</nationalNumberPattern>
        <possibleNumberPattern>\d{10,11}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>6(0\d|10)\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </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{1})(\d{4})(\d{4})">
          <leadingDigits>[2-478]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc >
        <nationalNumberPattern>[1-578]\d{4,14}</nationalNumberPattern>
        <possibleNumberPattern>\d{5,15}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[2378]\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>4\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>1800\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>190[0126]\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </premiumRate>
    </territory>

    <!-- Barbados -->
    <territory id="BB" countryCode="1" internationalPrefix="011">
    </territory>

    <!-- Brazil -->
    <!-- This country is used to test ShortNumberInfo, so at least the country calling code must be
         recognised by the library. -->
    <territory id="BR" countryCode="55">
    </territory>

    <!-- Bahamas -->
    <territory id="BS" countryCode="1" internationalPrefix="011"
               nationalPrefix="1">
      <generalDesc>
        <nationalNumberPattern>(242|8(00|66|77|88)|900)\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{7,10}</possibleNumberPattern>
      </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>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>242(357|359|457|557)\d{4}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>8(00|66|77|88)\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </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>
        <possibleNumberPattern>\d{6}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <exampleNumber>112345</exampleNumber>
      </fixedLine>
    </territory>

    <!-- Canada -->
    <territory id="CA" countryCode="1" internationalPrefix="011">
    </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. -->
    <territory id="CC" countryCode="61">
    </territory>

    <!-- China -->
    <!-- Used to test as-you-type-formatter with complicated number format patterns. -->
    <territory id="CN" countryCode="86">
      <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>
      </availableFormats>
    </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. -->
    <territory id="CX" countryCode="61" internationalPrefix="00">
    </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="([4-9]\d)(\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="([4-9]\d{3})(\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>
        <possibleNumberPattern>\d{2,14}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>(?:[24-6]\d{2}|3[03-9]\d|[789](?:[1-9]\d|0[2-9]))\d{1,8}</nationalNumberPattern>
        <exampleNumber>30123456</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1(5\d{9}|7\d{8}|6[02]\d{8}|63\d{7})</nationalNumberPattern>
        <possibleNumberPattern>\d{10,11}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900([135]\d{6}|9\d{7})</nationalNumberPattern>
        <possibleNumberPattern>\d{10,11}</possibleNumberPattern>
      </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>
        <possibleNumberPattern>\d{7}</possibleNumberPattern>
      </generalDesc>
    </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>
        <possibleNumberPattern>\d{6,10}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[1-6]\d{9}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>7[1-57-9]\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </mobile>
      <pager>
        <nationalNumberPattern>76\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </pager>
      <tollFree>
        <nationalNumberPattern>80\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>9[018]\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </premiumRate>
      <sharedCost>
        <nationalNumberPattern>8(?:4[3-5]|7[0-2])\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </sharedCost>
      <voip>
        <nationalNumberPattern>56\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </voip>
      <personalNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </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">
    </territory>

    <!-- Hungary -->
    <!-- This country has special logic in formatNumberForMobileDialing which must be tested. -->
    <territory id="HU" countryCode="36" nationalPrefix="06">
      <generalDesc>
        <nationalNumberPattern>30\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </generalDesc>
      <mobile>
        <nationalNumberPattern>30\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </mobile>
    </territory>

    <!-- Italy -->
    <!-- http://en.wikipedia.org/wiki/%2B39 -->
    <territory id="IT" countryCode="39" internationalPrefix="00" leadingZeroPossible="true">
      <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>
        <possibleNumberPattern>\d{6,11}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>0\d{9,10}</nationalNumberPattern>
        <possibleNumberPattern>\d{10,11}</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>3\d{8,9}</nationalNumberPattern>
        <possibleNumberPattern>\d{9,10}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80(?:0\d{6}|3\d{3})</nationalNumberPattern>
        <possibleNumberPattern>\d{6,9}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>89(?:2\d{3}|9\d{6})</nationalNumberPattern>
        <possibleNumberPattern>\d{6,9}</possibleNumberPattern>
      </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" leadingZeroPossible="true">
      <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>
        <possibleNumberPattern>\d{4}</possibleNumberPattern>
      </noInternationalDialling>
      <generalDesc>
        <nationalNumberPattern>07\d{5}|[1-357-9]\d{3,10}</nationalNumberPattern>
        <possibleNumberPattern>\d{4,11}</possibleNumberPattern>
      </generalDesc>
      <tollFree>
        <nationalNumberPattern>0777[01]\d{2}</nationalNumberPattern>
        <possibleNumberPattern>\d{7}</possibleNumberPattern>
        <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>
        <possibleNumberPattern>\d{4,10}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\d{2,3}|[2-9]\d{6,7})</nationalNumberPattern>
        <possibleNumberPattern>\d{4,10}</possibleNumberPattern>
        <exampleNumber>22123456</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1[0-25-9]\d{7,8}</nationalNumberPattern>
        <possibleNumberPattern>\d{9,10}</possibleNumberPattern>
        <exampleNumber>1023456789</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
        <exampleNumber>801234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>60[2-9]\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
        <exampleNumber>602345678</exampleNumber>
      </premiumRate>
      <personalNumber>
        <nationalNumberPattern>50\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
        <exampleNumber>5012345678</exampleNumber>
      </personalNumber>
      <voip>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
        <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>
        <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="(1)(\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="(1)(\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>
        <possibleNumberPattern>\d{7,11}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[2-9]\d{9}</nationalNumberPattern>
        <possibleNumberPattern>\d{7,10}</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1\d{10}</nationalNumberPattern>
        <possibleNumberPattern>\d{11}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </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>
        <possibleNumberPattern>\d{7,10}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>24099\d{3}|(?:3[2-79]|[479][2-689]|6[235-9])\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{7,8}</possibleNumberPattern>
      </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>
        <possibleNumberPattern>\d{8,10}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{6,7}</nationalNumberPattern>
        <possibleNumberPattern>\d{9,10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{6,7}</nationalNumberPattern>
        <possibleNumberPattern>\d{9,10}</possibleNumberPattern>
      </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>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </generalDesc>
      <mobile>
        <nationalNumberPattern>(?:5[01]|6[069]|7[289]|88)\d{7}</nationalNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{6}</nationalNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>70\d{7}</nationalNumberPattern>
      </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="([268]\d{2})(\d{2})(\d{2})(\d{2})">
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[268]\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <!-- 0876 numbers are mentioned in the plan, but none in use can be
        found. -->
        <nationalNumberPattern>262\d{6}</nationalNumberPattern>
        <exampleNumber>262161234</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>6(?:9[23]|47)\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
        <exampleNumber>692123456</exampleNumber>
      </mobile>
      <!-- 08* Numbers in Réunion are the same as those valid in France. -->
      <tollFree>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
        <exampleNumber>801234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>8(?:1[01]|2[0156]|84|9[0-37-9])\d{6}</nationalNumberPattern>
        <exampleNumber>810123456</exampleNumber>
      </premiumRate>
    </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>
        <!-- This specific pattern with the | is used to unit-test IsPossibleNumberWithReason. -->
        <possibleNumberPattern>
          \d{8}|
          \d{10,11}
        </possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[36]\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{8}</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>[89]\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{8}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>1?800\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10,11}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>1900\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{11}</possibleNumberPattern>
      </premiumRate>
    </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" nationalPrefixOptionalWhenFormatting="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})">
          <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>
        <possibleNumberPattern>\d{7}(?:\d{3})?</possibleNumberPattern>
        <exampleNumber>1234567890</exampleNumber>
      </generalDesc>
      <noInternationalDialling>
        <!-- This range is added for testing purposes only. -->
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </noInternationalDialling>
      <tollFree>
        <nationalNumberPattern>8(?:00|66|77|88)\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </premiumRate>
    </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>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>2696[0-4]\d{4}</nationalNumberPattern>
        <exampleNumber>269601234</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>639\d{6}</nationalNumberPattern>
        <exampleNumber>639123456</exampleNumber>
      </mobile>
      <!-- Same as in France. -->
      <tollFree>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
        <exampleNumber>801234567</exampleNumber>
      </tollFree>
    </territory>

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

    <!-- Universal International Premium 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>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
        <exampleNumber>123456789</exampleNumber>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>NA</nationalNumberPattern>
        <possibleNumberPattern>NA</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>NA</nationalNumberPattern>
        <possibleNumberPattern>NA</possibleNumberPattern>
      </mobile>
      <premiumRate>
        <nationalNumberPattern>\d{9}</nationalNumberPattern>
      </premiumRate>
    </territory>
  </territories>
</phoneNumberMetadata>
