<!-- Copyright (C) 2011 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: Lara Rennie
     @author: Shaopeng Jia

     Additional Phone Number Formatting information, containing alternative
     formats that are commonly used when writing phone numbers in certain
     countries. Note that this is in addition to the formatting information
     provided by the main PhoneNumberMetadata.xml file - formatting patterns
     should not be duplicated.

     Note also that only the most specific leading-digits pattern is present for
     each pattern - the less specific ones are used only by the
     AsYouTypeFormatter, and the AsYouTypeFormatter does not require information
     on alternate formatting patterns.

     For regions that share a country calling code, only the region with
     mainCountryForCode set to true in PhoneNumberMetadata.xml should be present
     here.

     Note: Territories are in alphabetical order by their IDs, which are based on ISO 3166-1
           two-letter country codes. The country names in the comments are the official short names
           in English according to ISO 3166-1.

     For more information on what each element represents, see
     resources/phonemetadata.proto
-->

<!DOCTYPE phoneNumberMetadata [
    <!ELEMENT phoneNumberMetadata (territories)>
    <!ELEMENT territories (territory+)>
    <!ELEMENT territory (availableFormats)>
    <!ELEMENT numberFormat (leadingDigits*, format, intlFormat*)>
    <!ELEMENT leadingDigits (#PCDATA)>
    <!ELEMENT format (#PCDATA)>
    <!ELEMENT intlFormat (#PCDATA)>

    <!ATTLIST territory countryCode CDATA #REQUIRED>
    <!ATTLIST numberFormat pattern CDATA #REQUIRED>
]>

<phoneNumberMetadata>
  <territories>
    <!-- United Arab Emirates (AE) -->
    <territory countryCode="971">
      <availableFormats>
        <numberFormat pattern="(5[0256])(\d{4})(\d{3})">
          <leadingDigits>5</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Argentina (AR) -->
    <territory countryCode="54">
      <availableFormats>
        <numberFormat pattern="(9)(\d{4})(\d{3})(\d{3})">
          <leadingDigits>9[23]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>[23]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Austria (AT) -->
    <territory countryCode="43">
      <availableFormats>
        <numberFormat pattern="(1)(\d{3})(\d{2})(\d{2,3})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(5)(\d{3,12})">
         <leadingDigits>5[079]</leadingDigits>
         <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(50)(\d{2})(\d{2})(\d{2,4})">
          <leadingDigits>50</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(5\d)(\d{2})(\d{2})(\d{2})(\d{2,4})">
          <leadingDigits>5[079]</leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
        <numberFormat pattern="(5\d)(\d{5})(\d{4,6})">
          <leadingDigits>5[079]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(5\d)(\d{6,7})">
          <leadingDigits>5[079]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{3,4})">
          <leadingDigits>
            316|
            46|
            51|
            732|
            6(?:
              44|
              5[0-3579]|
              [6-9]
            )|
            7(?:
              1|
              [28]0
            )|
            [89]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{2,3})">
          <leadingDigits>
            316|
            46|
            51|
            732|
            6(?:
              44|
              5[0-3579]|
              [6-9]
            )|
            7(?:
              1|
              [28]0
            )|
            [89]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3,4})">
          <leadingDigits>
            2|
            3(?:
              1[1-578]|
              [3-8]
            )|
            4[2378]|
            5[2-6]|
            6(?:
              [12]|
              4[1-35-9]|
              5[468]
            )|
            7(?:
              2[1-8]|
              35|
              4[1-8]|
              [5-79]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
          </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2,3})">
          <leadingDigits>
            316|
            46|
            51|
            732|
            6(?:
              44|
              5[0-3579]|
              [6-9]
            )|
            7(?:
              1|
              [28]0
            )|
            [89]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Australia (AU) -->
    <territory countryCode="61">
      <availableFormats>
        <numberFormat pattern="(1[389]\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            1(?:
              [38]00|
              90
            )
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(1[389]\d{2})(\d{6})">
          <leadingDigits>
            1(?:
              [38]00|
              90
            )
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(1)([389]\d{2})(\d{3})(\d{3})">
          <leadingDigits>
            1(?:
              [38]00|
              90
            )
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="([2378])(\d{8})">
          <leadingDigits>[2378]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Bulgaria (BG) -->
    <territory countryCode="359">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{2})(\d{2})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>
            48|
            8[7-9]|
            9[08]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            48|
            8[7-9]|
            9[08]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Brazil (BR) -->
    <territory countryCode="55">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{8})" >
          <leadingDigits>[1-9][1-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Costa Rica (CR) -->
    <territory countryCode="506">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{2})(\d{2})">
          <leadingDigits>
            [24-7]|
            8[3-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Germany (DE) -->
    <territory countryCode="49">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})">
          <leadingDigits>
            3[02]|
            40|
            [68]9
          </leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            3[02]|
            40|
            [68]9
          </leadingDigits>
          <format>$1/$2 $3 $4 $5</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{3,4})">
          <leadingDigits>
            3[02]|
            40|
            [68]9
          </leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{1,2})">
          <leadingDigits>
            3[02]|
            40|
            [68]9
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})(\d{2,3})">
          <leadingDigits>
            3[02]|
            40|
            [68]9
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d)(\d{2})(\d{2})">
          <leadingDigits>
            3[02]|
            40|
            [68]9
          </leadingDigits>
          <format>$1/$2 $3 $4 $5 $6</format>
        </numberFormat>
        <!-- 3 digit area codes. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{2,4})">
          <leadingDigits>
            2(?:
              \d1|
              0[2389]|
              1[24]|
              28|
              34
            )|
            3(?:
              [3-9][15]|
              40
            )|
            [4-8][1-9]1|
            9(?:
              06|
              [1-9]1
            )
          </leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})(\d{3,4})">
          <leadingDigits>
            2(?:
              \d1|
              0[2389]|
              1[24]|
              28|
              34
            )|
            3(?:
              [3-9][15]|
              40
            )|
            [4-8][1-9]1|
            9(?:
              06|
              [1-9]1
            )
          </leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{1,2})">
          <leadingDigits>
            2(?:
              \d1|
              0[2389]|
              1[24]|
              28|
              34
            )|
            3(?:
              [3-9][15]|
              40
            )|
            [4-8][1-9]1|
            9(?:
              06|
              [1-9]1
            )
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            2(?:
              \d1|
              0[2389]|
              1[24]|
              28|
              34
            )|
            3(?:
              [3-9][15]|
              40
            )|
            [4-8][1-9]1|
            9(?:
              06|
              [1-9]1
            )
          </leadingDigits>
          <format>$1/$2 $3 $4 $5</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{2})">
          <leadingDigits>
            2(?:
              \d1|
              0[2389]|
              1[24]|
              28|
              34
            )|
            3(?:
              [3-9][15]|
              40
            )|
            [4-8][1-9]1|
            9(?:
              06|
              [1-9]1
            )
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{2})(\d)">
          <leadingDigits>
            2(?:
              \d1|
              0[2389]|
              1[24]|
              28|
              34
            )|
            3(?:
              [3-9][15]|
              40
            )|
            [4-8][1-9]1|
            9(?:
              06|
              [1-9]1
            )
          </leadingDigits>
          <format>$1/$2 $3 $4 $5</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{2,3})">
          <leadingDigits>
            2(?:
              \d1|
              0[2389]|
              1[24]|
              28|
              34
            )|
            3(?:
              [3-9][15]|
              40
            )|
            [4-8][1-9]1|
            9(?:
              06|
              [1-9]1
            )
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <!-- 4 digit area codes. -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{1,4})">
          <leadingDigits>
            [24-6]|
            [7-9](?:
              \d[1-9]|
              [1-9]\d
            )|
            3(?:
              3(?:
                0[1-467]|
                2[127-9]|
                3[124578]|
                [46][1246]|
                7[1257-9]|
                8[1256]|
                9[145]
              )|
              4(?:
                2[135]|
                3[1357]|
                4[13578]|
                6[1246]|
                7[1356]|
                9[1346]
              )|
              5(?:
                0[14]|
                2[1-3589]|
                3[1357]|
                4[1246]|
                6[1-4]|
                7[1346]|
                8[13568]|
                9[1246]
              )|
              6(?:
                0[356]|
                2[1-489]|
                3[124-6]|
                4[1347]|
                6[13]|
                7[12579]|
                8[1-356]|
                9[135]
              )|
              7(?:
                2[1-7]|
                3[1357]|
                4[145]|
                6[1-5]|
                7[1-4]
              )|
              8(?:
                21|
                3[1468]|
                4[1347]|
                6[0135-9]|
                7[1467]|
                8[136]
              )|
              9(?:
                0[12479]|
                2[1358]|
                3[1357]|
                4[134679]|
                6[1-9]|
                7[136]|
                8[147]|
                9[1468]
              )
            )
          </leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4})(\d{1,4})">
          <leadingDigits>
            [24-6]|
            [7-9](?:
              \d[1-9]|
              [1-9]\d
            )|
            3(?:
              3(?:
                0[1-467]|
                2[127-9]|
                3[124578]|
                [46][1246]|
                7[1257-9]|
                8[1256]|
                9[145]
              )|
              4(?:
                2[135]|
                3[1357]|
                4[13578]|
                6[1246]|
                7[1356]|
                9[1346]
              )|
              5(?:
                0[14]|
                2[1-3589]|
                3[1357]|
                4[1246]|
                6[1-4]|
                7[1346]|
                8[13568]|
                9[1246]
              )|
              6(?:
                0[356]|
                2[1-489]|
                3[124-6]|
                4[1347]|
                6[13]|
                7[12579]|
                8[1-356]|
                9[135]
              )|
              7(?:
                2[1-7]|
                3[1357]|
                4[145]|
                6[1-5]|
                7[1-4]
              )|
              8(?:
                21|
                3[1468]|
                4[1347]|
                6[0135-9]|
                7[1467]|
                8[136]
              )|
              9(?:
                0[12479]|
                2[1358]|
                3[1357]|
                4[134679]|
                6[1-9]|
                7[136]|
                8[147]|
                9[1468]
              )
            )
          </leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})(\d{3})">
          <leadingDigits>
            [24-6]|
            [7-9](?:
              \d[1-9]|
              [1-9]\d
            )|
            3(?:
              3(?:
                0[1-467]|
                2[127-9]|
                3[124578]|
                [46][1246]|
                7[1257-9]|
                8[1256]|
                9[145]
              )|
              4(?:
                2[135]|
                3[1357]|
                4[13578]|
                6[1246]|
                7[1356]|
                9[1346]
              )|
              5(?:
                0[14]|
                2[1-3589]|
                3[1357]|
                4[1246]|
                6[1-4]|
                7[1346]|
                8[13568]|
                9[1246]
              )|
              6(?:
                0[356]|
                2[1-489]|
                3[124-6]|
                4[1347]|
                6[13]|
                7[12579]|
                8[1-356]|
                9[135]
              )|
              7(?:
                2[1-7]|
                3[1357]|
                4[145]|
                6[1-5]|
                7[1-4]
              )|
              8(?:
                21|
                3[1468]|
                4[1347]|
                6[0135-9]|
                7[1467]|
                8[136]
              )|
              9(?:
                0[12479]|
                2[1358]|
                3[1357]|
                4[134679]|
                6[1-9]|
                7[136]|
                8[147]|
                9[1468]
              )
            )
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{3})(\d{2})">
          <leadingDigits>
            [24-6]|
            [7-9](?:
              \d[1-9]|
              [1-9]\d
            )|
            3(?:
              3(?:
                0[1-467]|
                2[127-9]|
                3[124578]|
                [46][1246]|
                7[1257-9]|
                8[1256]|
                9[145]
              )|
              4(?:
                2[135]|
                3[1357]|
                4[13578]|
                6[1246]|
                7[1356]|
                9[1346]
              )|
              5(?:
                0[14]|
                2[1-3589]|
                3[1357]|
                4[1246]|
                6[1-4]|
                7[1346]|
                8[13568]|
                9[1246]
              )|
              6(?:
                0[356]|
                2[1-489]|
                3[124-6]|
                4[1347]|
                6[13]|
                7[12579]|
                8[1-356]|
                9[135]
              )|
              7(?:
                2[1-7]|
                3[1357]|
                4[145]|
                6[1-5]|
                7[1-4]
              )|
              8(?:
                21|
                3[1468]|
                4[1347]|
                6[0135-9]|
                7[1467]|
                8[136]
              )|
              9(?:
                0[12479]|
                2[1358]|
                3[1357]|
                4[134679]|
                6[1-9]|
                7[136]|
                8[147]|
                9[1468]
              )
            )
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{2})(\d{2})">
          <leadingDigits>
            [24-6]|
            [7-9](?:
              \d[1-9]|
              [1-9]\d
            )|
            3(?:
              3(?:
                0[1-467]|
                2[127-9]|
                3[124578]|
                [46][1246]|
                7[1257-9]|
                8[1256]|
                9[145]
              )|
              4(?:
                2[135]|
                3[1357]|
                4[13578]|
                6[1246]|
                7[1356]|
                9[1346]
              )|
              5(?:
                0[14]|
                2[1-3589]|
                3[1357]|
                4[1246]|
                6[1-4]|
                7[1346]|
                8[13568]|
                9[1246]
              )|
              6(?:
                0[356]|
                2[1-489]|
                3[124-6]|
                4[1347]|
                6[13]|
                7[12579]|
                8[1-356]|
                9[135]
              )|
              7(?:
                2[1-7]|
                3[1357]|
                4[145]|
                6[1-5]|
                7[1-4]
              )|
              8(?:
                21|
                3[1468]|
                4[1347]|
                6[0135-9]|
                7[1467]|
                8[136]
              )|
              9(?:
                0[12479]|
                2[1358]|
                3[1357]|
                4[134679]|
                6[1-9]|
                7[136]|
                8[147]|
                9[1468]
              )
            )
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{2})(\d{2,3})">
          <leadingDigits>
            [24-6]|
            [7-9](?:
              \d[1-9]|
              [1-9]\d
            )|
            3(?:
              3(?:
                0[1-467]|
                2[127-9]|
                3[124578]|
                [46][1246]|
                7[1257-9]|
                8[1256]|
                9[145]
              )|
              4(?:
                2[135]|
                3[1357]|
                4[13578]|
                6[1246]|
                7[1356]|
                9[1346]
              )|
              5(?:
                0[14]|
                2[1-3589]|
                3[1357]|
                4[1246]|
                6[1-4]|
                7[1346]|
                8[13568]|
                9[1246]
              )|
              6(?:
                0[356]|
                2[1-489]|
                3[124-6]|
                4[1347]|
                6[13]|
                7[12579]|
                8[1-356]|
                9[135]
              )|
              7(?:
                2[1-7]|
                3[1357]|
                4[145]|
                6[1-5]|
                7[1-4]
              )|
              8(?:
                21|
                3[1468]|
                4[1347]|
                6[0135-9]|
                7[1467]|
                8[136]
              )|
              9(?:
                0[12479]|
                2[1358]|
                3[1357]|
                4[134679]|
                6[1-9]|
                7[136]|
                8[147]|
                9[1468]
              )
            )
          </leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <!-- 5 digit area codes. -->
        <numberFormat pattern="(\d{5})(\d{3})(\d{3,4})">
          <leadingDigits>3</leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{5})(\d{4})(\d{3,4})">
          <leadingDigits>3</leadingDigits>
          <format>$1/$2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{5})(\d{3})(\d{3})(\d{3})">
          <leadingDigits>3</leadingDigits>
          <format>$1/$2 $3 $4</format>
        </numberFormat>
        <!-- Mobile number formatting rules. -->
        <numberFormat pattern="(1\d{3})(\d{2})(\d{3})(\d{2})">
          <leadingDigits>15</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(1\d{3})(\d{3})(\d{4})">
          <leadingDigits>15</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(1\d{3})(\d{4})(\d{3})">
          <leadingDigits>15</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(1\d{2})(\d{8})">
          <leadingDigits>15</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="([18]\d{2})(\d{2,3})(\d{3})(\d{2})">
          <leadingDigits>
            1[5-7]|
            800
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="([18]\d{2})(\d{3})(\d{3})(\d)">
          <leadingDigits>
            1[5-7]|
            800
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(8\d{2})(\d{6})(\d{2})(\d{1,4})">
          <leadingDigits>800</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d)(\d{3})(\d{3,4})">
          <leadingDigits>
            180|
            900[1359]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d)(\d{4})(\d{3,4})">
          <leadingDigits>
            180|
            900[1359]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{4,10})">
          <leadingDigits>
            180|
            900[1359]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})(\d{2})">
          <leadingDigits>
            900[1359]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Estonia (EE) -->
    <territory countryCode="372">
      <availableFormats>
        <!-- There are about 2 million search results for numbers written with the 6 separate. -->
        <numberFormat pattern="(\d)(\d{3})(\d{3})">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})">
          <leadingDigits>
            [69]|
            4[3-8]|
            5(?:
              [02]|
              1(?:
                [0-8]|
                95
              )|
              5[0-478]|
              6(?:
                4[0-4]|
                5[1-589]
              )
            )|
            7[1-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})">
          <leadingDigits>
            [69]|
            4[3-8]|
            5(?:
              [02]|
              1(?:
                [0-8]|
                95
              )|
              5[0-478]|
              6(?:
                4[0-4]|
                5[1-589]
              )
            )|
            7[1-9]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Spain (ES) -->
    <territory countryCode="34" >
      <availableFormats>
        <numberFormat pattern="([5-9]\d{2})(\d{3})(\d{3})">
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(9\d)(\d{3})(\d{2})(\d{2})">
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Finland (FI) -->
    <!-- Metadata shared with Åland (AX) -->
    <territory countryCode="358">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3,4})">
          <leadingDigits>
            [14]|
            2[09]|
            50|
            7[135]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3,4})">
          <leadingDigits>
            [25689][1-8]|
            3
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Fiji (FJ) -->
    <territory countryCode="679">
      <availableFormats>
        <numberFormat pattern="(7\d)(\d{3})(\d{2})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Great Britain (GB) -->
    <territory countryCode="44" >
      <availableFormats>
        <!-- London. -->
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>20</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{2})(\d{2})">
          <leadingDigits>20</leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
        <!-- 7ddd (not 70, 76) with 10 digits. Note: DOES include 7624 when used for IM. Also
             includes the four-digit fixed-line codes. -->
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>
            1[2-48][02-9]|
            7(?:
              [1-5789]|
              624
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- 7ddd (not 70, 76) with 10 digits.-->
        <numberFormat pattern="(\d{3})(\d{4})(\d{3})">
          <leadingDigits>7[1-5789]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(80\d)(\d{3,4})(\d{3})">
          <leadingDigits>80</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Georgia (GE) -->
    <territory countryCode="995">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d)(\d{2})(\d{2})(\d{2})" >
          <leadingDigits>[348]</leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Gibraltar (GI) -->
    <territory countryCode="350" >
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Greece (GR) -->
    <territory countryCode="30">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>21</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Croatia (HR) -->
    <territory countryCode="385">
      <availableFormats>
       <numberFormat pattern="(1)(\d{3})(\d{4})">
         <leadingDigits>1</leadingDigits>
         <format>$1 $2 $3</format>
       </numberFormat>
       <numberFormat pattern="(1)(\d{3})(\d{2})(\d{2})">
         <leadingDigits>1</leadingDigits>
         <format>$1 $2 $3 $4</format>
       </numberFormat>
       <numberFormat pattern="(6[09])(\d{3})(\d{4})">
         <leadingDigits>6[09]</leadingDigits>
         <format>$1 $2 $3</format>
       </numberFormat>
       <numberFormat pattern="(\d{2})(\d{2})(\d{4})">
         <leadingDigits>[2-69]</leadingDigits>
         <format>$1 $2 $3</format>
       </numberFormat>
      </availableFormats>
    </territory>

    <!-- Hungary (HU) -->
    <territory countryCode="36">
      <availableFormats>
        <numberFormat pattern="(1)(\d{4})(\d{3})">
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{3})">
          <leadingDigits>[2-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Indonesia (ID) -->
    <territory countryCode="62">
      <availableFormats>
        <numberFormat nationalPrefixFormattingRule="($NP$FG)"
          pattern="(\d{2})(\d{3,4})(\d{4})">
          <leadingDigits>
            2[124]|
            [36]1
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Israel (IL) -->
    <territory countryCode="972">
      <availableFormats>
        <numberFormat nationalPrefixFormattingRule="$NP$FG"
          pattern="([2-489])(\d{3})(\d{2})(\d{2})">
          <leadingDigits>[2-489]</leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- India (IN) -->
    <territory countryCode="91">
      <availableFormats>
        <!-- Mobile numbers. -->
        <numberFormat nationalPrefixFormattingRule="($NP$FG)"
          pattern="(\d{2})(\d{2})(\d{6})">
           <leadingDigits>
             7(?:
               0[2-8]|
               2[0579]|
               3[057-9]|
               4[0-389]|
               6[0-35-9]|
               [57]|
               8[0-79]
             )|
             8(?:
               0[015689]|
               1[0-57-9]|
               2[2356-9]|
               3[0-57-9]|
               [45]|
               6[02457-9]|
               7[1-69]|
               8[0124-9]|
               9[02-9]
             )|
             9
           </leadingDigits>
           <leadingDigits>
             7(?:
               0(?:
                 2[2-9]|
                 [3-7]|
                 8[0-7]
               )|
               2(?:
                 0[04-9]|
                 5[09]|
                 7[5-8]|
                 9[389]
               )|
               3(?:
                 0[1-9]|
                 [58]|
                 7[3679]|
                 9[689]
               )|
               4(?:
                 0[1-9]|
                 1[15-9]|
                 [29][89]|
                 39|
                 8[389]
               )|
               5(?:
                 [034678]|
                 2[03-9]|
                 5[017-9]|
                 9[7-9]
               )|
               6(?:
                 0[0-27]|
                 1[0-257-9]|
                 2[0-4]|
                 3[19]|
                 5[4589]|
                 [6-9]
               )|
               7(?:
                 0[2-9]|
                 [1-79]|
                 8[1-9]
               )|
               8(?:
                 [0-7]|
                 9[013-9]
               )
             )|
             8(?:
               0(?:
                 [01589]|
                 6[67]
               )|
               1(?:
                 [02-589]|
                 1[0135-9]|
                 7[0-79]
               )|
               2(?:
                 [236-9]|
                 5[1-9]
               )|
               3(?:
                 [0357-9]|
                 4[1-9]
               )|
               [45]|
               6[02457-9]|
               7[1-69]|
               8(?:
                 [0-26-9]|
                 44|
                 5[2-9]
               )|
               9(?:
                 [035-9]|
                 2[2-9]|
                 4[0-8]
               )
             )|
             9
           </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat nationalPrefixFormattingRule="($NP$FG)"
          pattern="(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})">
           <leadingDigits>
             7(?:
               0[2-8]|
               2[0579]|
               3[057-9]|
               4[0-389]|
               6[0-35-9]|
               [57]|
               8[0-79]
             )|
             8(?:
               0[015689]|
               1[0-57-9]|
               2[2356-9]|
               3[0-57-9]|
               [45]|
               6[02457-9]|
               7[1-69]|
               8[0124-9]|
               9[02-9]
             )|
             9
           </leadingDigits>
           <leadingDigits>
             7(?:
               0(?:
                 2[2-9]|
                 [3-7]|
                 8[0-7]
               )|
               2(?:
                 0[04-9]|
                 5[09]|
                 7[5-8]|
                 9[389]
               )|
               3(?:
                 0[1-9]|
                 [58]|
                 7[3679]|
                 9[689]
               )|
               4(?:
                 0[1-9]|
                 1[15-9]|
                 [29][89]|
                 39|
                 8[389]
               )|
               5(?:
                 [034678]|
                 2[03-9]|
                 5[017-9]|
                 9[7-9]
               )|
               6(?:
                 0[0-27]|
                 1[0-257-9]|
                 2[0-4]|
                 3[19]|
                 5[4589]|
                 [6-9]
               )|
               7(?:
                 0[2-9]|
                 [1-79]|
                 8[1-9]
               )|
               8(?:
                 [0-7]|
                 9[013-9]
               )
             )|
             8(?:
               0(?:
                 [01589]|
                 6[67]
               )|
               1(?:
                 [02-589]|
                 1[0135-9]|
                 7[0-79]
               )|
               2(?:
                 [236-9]|
                 5[1-9]
               )|
               3(?:
                 [0357-9]|
                 4[1-9]
               )|
               [45]|
               6[02457-9]|
               7[1-69]|
               8(?:
                 [0-26-9]|
                 44|
                 5[2-9]
               )|
               9(?:
                 [035-9]|
                 2[2-9]|
                 4[0-8]
               )
             )|
             9
           </leadingDigits>
          <format>$1 $2 $3 $4 $5</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Japan (JP) -->
    <territory countryCode="81" >
      <availableFormats>
        <!-- Toll-free, premium-rate and UAN numbers -->
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})">
          <leadingDigits>
            (?:
              12|
              57|
              99
            )0
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            (?:
              12|
              57|
              99
            )0
          </leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{4})(\d{2})">
          <leadingDigits>
            (?:
              12|
              57|
              99
            )0
          </leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Cambodia (KH) -->
    <territory countryCode="855">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2,3})">
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Sri Lanka (LK) -->
    <territory countryCode="94">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{3})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Luxembourg (LU) -->
    <territory countryCode="352">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Moldova, Rep. of (MD) -->
    <territory countryCode="373">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            22|
            [367]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
          <leadingDigits>[67]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Myanmar (MM) -->
    <territory countryCode="95">
      <availableFormats>
        <numberFormat pattern="(9)(\d{4})(\d{5})">
          <leadingDigits>925</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Nicaragua (NI) -->
    <territory  countryCode="505">
      <availableFormats>
        <numberFormat pattern="(\d)(\d{3})(\d{4})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Netherlands (NL) -->
    <territory  countryCode="31">
      <availableFormats>
        <numberFormat pattern="([1-578]\d)(\d{4})(\d{3})">
          <leadingDigits>
            1[035]|
            2[0346]|
            3[03568]|
            4[0356]|
            5[0358]|
            7|
            8[4578]
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="([1-5]\d{2})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>
            1[16-8]|
            2[259]|
            3[124]|
            4[17-9]|
            5[124679]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Papua New Guinea (PG) -->
    <territory countryCode="675">
      <availableFormats>
        <numberFormat pattern="(7\d{2})(\d{2})(\d{3})">
          <leadingDigits>7</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Philippines (PH) -->
    <territory countryCode="63">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{4})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Portugal (PT) -->
    <territory countryCode="351" >
      <availableFormats>
        <!-- Lisbon/Porto numbers are usually formatted with the 21 or 22 separated - but sometimes
             they are formatted as 21X or 22X. -->
        <numberFormat pattern="(2\d{2})(\d{3})(\d{3})">
          <leadingDigits>2[12]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <!-- Commonly used mobile formatting pattern. -->
        <numberFormat pattern="(9\d)(\d{3})(\d{4})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})">
          <leadingDigits>
            2[12]|
            9
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Paraguay (PY) -->
    <territory countryCode="595">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})">
          <leadingDigits>
            (?:
              [26]1|
              3[289]|
              4[124678]|
              7[123]|
              8[1236]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Serbia (RS )-->
    <territory countryCode="381">
      <availableFormats>
        <numberFormat pattern="([23]\d{2})(\d{4,9})">
          <leadingDigits>
            (?:
              2[389]|
              39
            )0
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="([1-3]\d)(\d{3})(\d{3})">
          <leadingDigits>
            1|
            2(?:
              [0-24-7]|
              [389][1-9]
            )|
            3(?:
              [0-8]|
              9[1-9]
            )
          </leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="([1-3]\d)(\d{2})(\d{2})(\d{3})">
          <leadingDigits>
            1|
            2(?:
              [0-24-7]|
              [389][1-9]
            )|
            3(?:
              [0-8]|
              9[1-9]
            )
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(6\d)(\d{3})(\d{2})(\d{2})">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(6\d)(\d{3})(\d{3})">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Russian Federation (RU) -->
    <territory countryCode="7">
      <availableFormats>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>[346-9]</leadingDigits>
          <format>$1 $2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{5})(\d{5})">
          <leadingDigits>[346-9]</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[346-9]</leadingDigits>
          <format>$1 $2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{2})(\d{3})">
          <leadingDigits>[346-9]</leadingDigits>
          <format>$1 $2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d)(\d{2})(\d{2})(\d{2})">
          <leadingDigits>[346-9]</leadingDigits>
          <format>$1-$2 $3-$4-$5</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Thailand (TH) -->
    <territory countryCode="66">
      <availableFormats>
        <!-- Over a million of the search results are formatted in two blocks like this. -->
        <numberFormat pattern="(2\d{3})(\d{4})">
          <leadingDigits>2</leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Tonga (TO) -->
    <territory countryCode="676">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{5})">
          <leadingDigits>
            7[5-9]|
            8[47-9]
          </leadingDigits>
          <format>$1 $2</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Turkey (TR) -->
    <territory countryCode="90">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{2})(\d{2})">
          <leadingDigits>
            [23589]|
            4(?:
              [0-35-9]|
              4[0-35-9]
            )
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Tanzania (TZ) -->
    <territory countryCode="255">
      <availableFormats>
        <numberFormat pattern="([67]\d)(\d{3})(\d{4})">
          <leadingDigits>[67]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="([67]\d)(\d{4})(\d{3})">
          <leadingDigits>[67]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Ukraine (UA) -->
    <territory countryCode="380" >
      <availableFormats>
        <numberFormat pattern="([3-689]\d)(\d{3})(\d{2})(\d{2})">
          <leadingDigits>
            [38]9|
            4(?:
              [45][0-5]|
              87
            )|
            5(?:
              0|
              6(?:
                3[14-7]|
                7
              )|
              7[37]
            )|
            6[36-8]|
            9[1-9]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <!-- Less common but still sometimes used. -->
        <numberFormat pattern="([3-689]\d)(\d{2})(\d{3})(\d{2})">
          <leadingDigits>
            [38]9|
            4(?:
              [45][0-5]|
              87
            )|
            5(?:
              0|
              6(?:
                3[14-7]|
                7
              )|
              7[37]
            )|
            6[36-8]|
            9[1-9]
          </leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Venezuela (VE) -->
    <territory countryCode="58">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- Viet Nam (VN) -->
    <territory countryCode="84">
      <availableFormats>
        <numberFormat pattern="(9\d{2})(\d{3})(\d{3})">
          <leadingDigits>9</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="([48])(\d{2})(\d{3})(\d{3})">
          <leadingDigits>[48]</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
      </availableFormats>
    </territory>

    <!-- South Africa (ZA) -->
    <territory countryCode="27">
      <availableFormats>
        <numberFormat pattern="(86\d)(\d{3})(\d{3})">
          <leadingDigits>86[1-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
    </territory>
  </territories>
</phoneNumberMetadata>
