Metadata update v7.0.3
[platform/upstream/libphonenumber.git] / resources / PhoneNumberMetadata.xml
index 6a737ff..8e73406 100644 (file)
          -->
     <territory id="AR" countryCode="54" internationalPrefix="00" nationalPrefix="0"
        nationalPrefixForParsing="
-         0?(?:
-           (11|
+         0?(?:(
+            11|
             2(?:
               2(?:
                 02?|
                8[2578]
              )|
              4(?:
-               0[124-9]|
+               0[0-24-9]|
                [12]|
                3[5-8]?|
                4[24-7]|
              )|
              6[24]|
              7(?:
+               [069]|
                1[1568]|
                2[15]|
                3[145]|
                4[13]|
                5[14-8]|
-               [069]|
                7[2-57]|
                8[126]
              )|
                9[124]
              )
            )
-         )?15
-       )?"
+         )?15)?"
        nationalPrefixTransformRule="9$1" nationalPrefixFormattingRule="$NP$FG"
        mobileNumberPortableRegion="true">
       <references>
         <!-- On the following link, click on Indicativos Interurbanos to access detailed
              information. -->
         <sourceUrl>http://www.cnc.gov.ar/infotecnica/numeracion/Index.asp</sourceUrl>
+        <!-- Download XLS spreadsheet from "Númeración Geográfica" link on following page: -->
+        <sourceUrl>http://www.cnc.gob.ar/asignaciones-a-la-fecha_p445</sourceUrl>
         <sourceUrl>http://en.wikipedia.org/wiki/+54</sourceUrl>
       </references>
       <availableFormats>
           <intlFormat>$1 $2 $3-$4</intlFormat>
         </numberFormat>
         <numberFormat pattern="(9)(\d{3})(\d{3})(\d{4})">
-          <!-- Some 4-digit area codes actually are caught by this rule. Preference is given however
-               to the 3-digit area codes, since they are considerably larger communities. -->
+          <!-- The regular expressions below were generated semi-automatically from data extracted
+               from the XLS spreadsheet downloaded from the "Númeración Geográfica" link cited
+               above. Each pattern captures all 3-3-4 prefixes for its length, but may also capture
+               some 4-2-4 cases.
+
+               In cases where a range contains both 3-3-4 and 4-2-4 prefixes, the most commonly used
+               one should be considered the default.
+               * If there are more distinct 4-2-4 prefixes, then the regular expression should
+                 INCLUDE only the explicitly mentioned 3-3-4 prefixes.
+               * If there are more distinct 3-3-4 prefixes, then the regular expression should
+                 EXCLUDE only the explicitly mentioned 4-2-4 prefixes.
+               This should help maximize the chances of new ranges automatically being assigned to
+               the right form.
+
+               In the final (most specific) regular expression, the few remaining ambiguous cases
+               are decided by comparing usage counts. Any manual edits to these expressions not
+               reflected in the XLS spreadsheet must be clearly called out below:
+
+               Added Manually as 3-3-4 format:
+               * 2981 (General Roca, Río Negro) : Numbers found online suggest 3-3-4
+
+               See also:
+               https://github.com/googlei18n/libphonenumber/issues/611
+               https://github.com/googlei18n/libphonenumber/issues/559
+               -->
+          <!-- Do NOT copy this into the section below. Removing the leading '9' will make it match
+               only 2 digits and the first <leadingDigits> section must always match 3 digits. -->
           <leadingDigits>
             9(?:
               2[234689]|
               3[3-8]
             )
           </leadingDigits>
+          <!-- If modified, copy this expression into the section below, minus the leading '9' -->
           <leadingDigits>
             9(?:
               2(?:
               )|
               3(?:
                 36|
-                4[12358]|
+                4[1-358]|
                 5[138]|
                 6[24]|
                 7[069]|
               )
             )
           </leadingDigits>
-          <!-- We exclude here several 294X four-digit area codes: 2940, 2942, 2945, 2946 and 2948,
-               298[23], and several 38[3578]X four-digit area codes. -->
+          <!-- Note that some patterns appear as both 3 and 4 digit area codes. In these cases
+               (to avoid going to 6 digits of discrimination) we simply pick the one with the
+               most uses. Patterns excluded from this expression will be treated as 4-2-4:
+               - XXXX (usage count as 3-digit code:usage count as 4-digit code)
+               - 2646 (7:15)   - excluded
+               - 3435 (39:63)  - excluded
+               - 3436 (16:54)  - excluded
+               - 3454 (90:48)
+               - 3455 (13:94)  - excluded
+               - 3456 (3:93)   - excluded
+               - 3584 (143:65)
+               - 3585 (21:42)  - excluded
+               - 3854 (115:73)
+               - 3855 (76:40)
+               - 3856 (19:44)  - excluded
+               - 3876 (56:99)  - excluded
+               - 3885 (120:45)
+               - 3886 (3:137)  - excluded
+               -->
+          <!-- If modified, copy this expression into the section below, minus the leading '9' -->
           <leadingDigits>
             9(?:
               2(?:
-                2[013]|
-                3[067]|
+                2(?:
+                  0[013-9]|
+                  [13]
+                )|
+                3(?:
+                  0[013-9]|
+                  [67]
+                )|
                 49|
-                6[01346]|
-                80|
+                6(?:
+                  [0136]|
+                  4[0-59]
+                )|
+                8|
                 9(?:
-                  [179]|
-                  4[13479]|
-                  8[014-9]
+                  [19]|
+                  44|
+                  7[013-9]|
+                  8[14]
                 )
               )|
               3(?:
                 36|
-                4[12358]|
+                4(?:
+                  [12]|
+                  [358]4
+                )|
                 5(?:
-                  [18]|
-                  3[014-689]
+                  1|
+                  3[0-24-689]|
+                  8[46]
                 )|
-                6[24]|
+                6|
                 7[069]|
                 8(?:
                   [01]|
-                  3[013469]|
-                  5[0-39]|
-                  7[0-2459]|
-                  8[0-49]
+                  34|
+                  [578][45]
                 )
               )
             )
         </numberFormat>
         <!-- These patterns are a copy of the mobile patterns with the leading 9 removed. -->
         <numberFormat pattern="(\d{3})(\d{3})(\d{4})" nationalPrefixOptionalWhenFormatting="true">
+          <!-- Never modify this manually, always copy from above and remove leading '9' -->
           <leadingDigits>
             2(?:
               2[013]|
             )|
             3(?:
               36|
-              4[12358]|
+              4[1-358]|
               5[138]|
               6[24]|
               7[069]|
               8[013578]
             )
           </leadingDigits>
-          <!-- We exclude here several 294X four-digit area codes: 2940, 2942, 2945, 2946 and 2948,
-               298[23], and several 38[3578]X four-digit area codes. -->
+          <!-- Never modify this manually, always copy from above and remove leading '9' -->
           <leadingDigits>
             2(?:
-              2[013]|
-              3[067]|
+              2(?:
+                0[013-9]|
+                [13]
+              )|
+              3(?:
+                0[013-9]|
+                [67]
+              )|
               49|
-              6[01346]|
-              80|
+              6(?:
+                [0136]|
+                4[0-59]
+              )|
+              8|
               9(?:
-                [179]|
-                4[13479]|
-                8[014-9]
+                [19]|
+                44|
+                7[013-9]|
+                8[14]
               )
             )|
             3(?:
               36|
-              4[12358]|
+              4(?:
+                [12]|
+                [358]4
+              )|
               5(?:
-                [18]|
-                3[0-689]
+                1|
+                3[0-24-689]|
+                8[46]
               )|
-              6[24]|
+              6|
               7[069]|
               8(?:
                 [01]|
-                3[013469]|
-                5[0-39]|
-                7[0-2459]|
-                8[0-49]
+                34|
+                [578][45]
               )
             )
           </leadingDigits>
         <nationalNumberPattern>
           (?:
             1(?:
-              3[13-6]|
+              3[1356]|
               6[0156]|
               7\d
             )\d|
                 0\d|
                 3[12]|
                 44|
-                88
+                7[7-9]
               )|
               9[69][69]
             )|
             7(?:
-              7\d{2}|
-              178
+              1(?:
+                11|
+                78
+              )|
+              7\d{2}
             )
           )\d{4}
         </nationalNumberPattern>
         <exampleNumber>17001234</exampleNumber>
       </fixedLine>
       <!-- 31 is assigned to Royal Court, as per documents on Bahrain's own telecom site, even
-           though it is omitted from the ITU document. 356 was added based on numbers found
-           online. -->
+           though it is omitted from the ITU document. -->
       <mobile>
         <nationalNumberPattern>
           (?:
             3(?:
               [1-4679]\d|
-              5[01356]|
-              8[0-48]
+              5[013569]|
+              8[0-47-9]
             )\d|
             6(?:
               3(?:
               )|
               6(?:
                 [69]\d|
-                3[03-9]
+                3[03-9]|
+                7[0-6]
               )
             )
           )\d{4}
             4[0-24-9]|
             5[4-9]|
             6[015-79]|
-            7[57]
+            7[578]
           )\d{6}
         </nationalNumberPattern>
         <exampleNumber>01234567</exampleNumber>
     </territory>
 
     <!-- China -->
-    <territory id="CN" countryCode="86" internationalPrefix="(1[1279]\d{3})?00"
+    <!-- The international/national prefix patterns must not collide with valid prefixes such
+         as 170, 176, 177 and 178. 179XX00 is a valid calling prefix, see: www.chahaoba.com/179 -->
+    <territory id="CN" countryCode="86" internationalPrefix="(1(?:[129]\d{3}|79\d{2}))?00"
                preferredInternationalPrefix="00" nationalPrefix="0"
-               nationalPrefixForParsing="(1[1279]\d{3})|0">
+               nationalPrefixForParsing="(1(?:[129]\d{3}|79\d{2}))|0">
       <references>
         <sourceUrl>http://www.itu.int/oth/T020200002B/en</sourceUrl>
       </references>
               91
             )|
             8(?:
-              71|
+              [57]1|
               98
             )
           </leadingDigits>
               1[236-8]|
               2[5-7]|
               3|
-              5[1-9]|
+              5[4-9]|
               7[02-9]|
               8[3678]|
               9[1-7]
           <leadingDigits>10800</leadingDigits>
           <format>$1 $2 $3</format>
         </numberFormat>
+        <numberFormat pattern="(\d{3})(\d{7,8})">
+          <leadingDigits>950</leadingDigits>
+          <format>$1 $2</format>
+        </numberFormat>
       </availableFormats>
       <generalDesc>
         <nationalNumberPattern>
           [1-7]\d{6,11}|
           8[0-357-9]\d{6,9}|
-          9\d{7,9}
+          9\d{7,10}
         </nationalNumberPattern>
         <possibleNumberPattern>\d{4,12}</possibleNumberPattern>
       </generalDesc>
             (?:
               10
             )?8
-          )00\d{7}
+          )00\d{7}|
+          950\d{7,8}
         </nationalNumberPattern>
         <possibleNumberPattern>\d{10,12}</possibleNumberPattern>
         <exampleNumber>4001234567</exampleNumber>
               91
             )|
             8(?:
-              71|
+              [57]1|
               98
             )
           )(?:
               1[236-8]|
               2[5-7]|
               3\d|
-              5[1-9]|
+              5[4-9]|
               7[02-9]|
               8[3678]|
               9[1-7]
              based on online searches. -->
         <nationalNumberPattern>
           400\d{7}|
+          950\d{7,8}|
           (?:
             10|
             2[0-57-9]|
               1[236-8]|
               2[5-7]|
               [37]\d|
-              5[1-9]|
+              5[14-9]|
               8[3678]|
               9[1-8]
             )|
             )
           )96\d{3,4}
         </nationalNumberPattern>
-        <possibleNumberPattern>\d{7,10}</possibleNumberPattern>
+        <possibleNumberPattern>\d{7,11}</possibleNumberPattern>
         <exampleNumber>4001234567</exampleNumber>
       </sharedCost>
     </territory>
             2[034678]\d|
             5(?:
               [047]\d|
-              54|
+              5[3-6]|
               6[01]
             )
           )\d{6}
       <mobile>
         <nationalNumberPattern>1[0-26-9]\d{7,8}</nationalNumberPattern>
         <possibleNumberPattern>\d{9,10}</possibleNumberPattern>
-        <exampleNumber>1023456789</exampleNumber>
+        <exampleNumber>1000000000</exampleNumber>
       </mobile>
       <pager>
         <nationalNumberPattern>15\d{7,8}</nationalNumberPattern>
           (?:
             5(?:
               [05]\d|
-              1[0-6]
+              1[0-7]
             )|
             6(?:
               0[034679]|
               55|
               6[069]|
               [79]\d|
-              8[089]
+              8[07-9]
             )
           )\d{5}
         </nationalNumberPattern>
         <!-- Even though 20 is listed in the fixed-line plan, other documentation clarify that it is
              for VOIP. Furthermore, even though the plan says that numbers beginning with 2[346-8]
              must be exactly 8 digits, from information found online it seems that they can actually
-             be 6 (but not 7) digits long. -->
+             be 6 or 7 digits long. -->
         <nationalNumberPattern>
           (?:
             2(?:
               [259]\d{2,9}|
-              [346-8]\d{4}(?:\d{2})?
+              [346-8]\d{4,6}
             )|
             (?:
               [3457]\d{2}|
     </territory>
 
     <!-- Montenegro -->
+    <!-- According to EKIP, the detailed phone number assignments are published on their
+         website (regulation:
+         http://www.ekip.me/download/Law%20on%20Electronic%20Communications%20(updated)%204.9.2013%20(1)nova%20verzija.pdf
+         ). Thus ITU updates always need to be combined with the information at the below ekip.me source URL. -->
     <territory id="ME" countryCode="382" internationalPrefix="00" nationalPrefix="0"
                nationalPrefixFormattingRule="$NP$FG">
       <references>
       </references>
       <availableFormats>
          <numberFormat pattern="(\d{2})(\d{3})(\d{3})">
-          <leadingDigits>[2-57-9]|6[3789]</leadingDigits>
+          <leadingDigits>[2-57-9]|6[036-9]</leadingDigits>
           <leadingDigits>
             [2-57-9]|
             6(?:
-              [389]|
+              [03689]|
               7(?:
                 [0-8]|
                 9[3-9]
             20[2-8]|
             3(?:
               0[2-7]|
-              1[35-7]|
-              2[3567]|
+              [12][35-7]|
               3[4-7]
             )|
             4(?:
-              0[237]|
-              1[27]
+              0[2367]|
+              1[267]
             )|
             5(?:
-              0[47]|
-              1[27]|
-              2[378]
+              0[467]|
+              1[267]|
+              2[367]
             )
           )\d{5}
         </nationalNumberPattern>
         <exampleNumber>30234567</exampleNumber>
       </fixedLine>
       <mobile>
-        <!-- Mobile numbers start with 632, 67, 68 or 69. -->
+        <!-- Mobile numbers start with 600, 632, 661, 67, 68 or 69. -->
         <nationalNumberPattern>
           6(?:
+            00\d|
             32\d|
             [89]\d{2}|
+            61\d|
             7(?:
               [0-8]\d|
               9(?:
         <exampleNumber>67622901</exampleNumber>
       </mobile>
       <tollFree>
-        <!-- All toll free numbers have prefix 80 followed by 02 or 08. -->
-        <nationalNumberPattern>800[28]\d{4}</nationalNumberPattern>
+        <!-- All toll free numbers have prefix 80. -->
+        <nationalNumberPattern>80\d{6}</nationalNumberPattern>
         <possibleNumberPattern>\d{8}</possibleNumberPattern>
         <exampleNumber>80080002</exampleNumber>
       </tollFree>
       <premiumRate>
-        <!-- Numbers with prefix 88, 94 or 95 are services with additional charges. -->
+        <!-- Numbers with prefix 94 or 95 are services with additional charges. -->
         <nationalNumberPattern>
           (?:
-            88\d|
             9(?:
-              4[13-8]|
-              5[16-8]
+              4[1568]|
+              5[178]
             )
           )\d{5}
         </nationalNumberPattern>
         <!-- Pattern for fixed-line formats. -->
         <numberFormat pattern="([34679])(\d{3})(\d{4})">
           <leadingDigits>
-            [3467]|
+            [346]|
+            7[2-57-9]|
             9[1-9]
           </leadingDigits>
           <format>$1-$2 $3</format>
               [69]|
               7[0-35-9]
             )|
+            70|
             86
           </leadingDigits>
           <format>$1 $2 $3</format>
         <possibleNumberPattern>\d{7,11}</possibleNumberPattern>
       </generalDesc>
       <fixedLine>
-        <!-- 07 788 was assigned to Voxbox according to
-             http://www.nad.org.nz/07GeographicalCodes.php -->
         <nationalNumberPattern>
           (?:
             3[2-79]|
-            [49][2-689]|
+            [49][2-9]|
             6[235-9]|
-            7[2-5789]
+            7[2-57-9]
           )\d{6}|
           24099\d{3}
         </nationalNumberPattern>
         <possibleNumberPattern>\d{9,11}</possibleNumberPattern>
         <exampleNumber>900123456</exampleNumber>
       </premiumRate>
+      <personalNumber>
+        <nationalNumberPattern>70\d{7}</nationalNumberPattern>
+        <possibleNumberPattern>\d{9}</possibleNumberPattern>
+        <exampleNumber>701234567</exampleNumber>
+      </personalNumber>
     </territory>
 
     <!-- Oman -->
         <exampleNumber>40123</exampleNumber>
       </fixedLine>
       <mobile>
+        <!-- The 795 prefix is not in the ITU plan (5.XII.2014), but was added because such a number
+             was dialed successfully. -->
         <nationalNumberPattern>
           48\d{3}|
           7(?:
+            30|
             [46-8]\d|
             5[025-9]|
-            9[0-4]
+            9[0-5]
           )\d{4}|
           8[4-8]\d{5}|
           9(?:
         <sourceUrl>http://www.itu.int/oth/T02020000B4/en</sourceUrl>
       </references>
       <availableFormats>
-        <!-- Should be formatted in one block, apart from the specific series below. -->
         <numberFormat pattern="(8\d{2})(\d{3,4})">
           <leadingDigits>8</leadingDigits>
           <format>$1 $2</format>
           <leadingDigits>7</leadingDigits>
           <format>$1 $2</format>
         </numberFormat>
+        <numberFormat pattern="(\d{5})">
+          <leadingDigits>[2-6]</leadingDigits>
+          <format>$1</format>
+        </numberFormat>
       </availableFormats>
       <generalDesc>
         <nationalNumberPattern>[2-8]\d{4,6}</nationalNumberPattern>