1 <!-- Copyright (C) 2009 The Libphonenumber Authors 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 15 @author: Shaopeng Jia 16 17 MetaData on Phone Number Plan and formatting rules. This file is used 18 solely for the purpose of unittesting, so data in this file is not 19 necessarily consistent with that of PhoneNumberMetaData.xml. 20 --> 21 22 <phoneNumberMetadata> 23 <territories> 24 <!-- Andorra --> 25 <territory id="AD" countryCode="376" internationalPrefix="00"> 26 </territory> 27 28 <!-- United Arab Emirates --> 29 <!-- Added since when formatting the number for mobile dialling we have special rules to handle 30 it. --> 31 <territory id="AE" countryCode="971" internationalPrefix="00"> 32 <generalDesc> 33 <nationalNumberPattern>[1-9]\d{8}</nationalNumberPattern> 34 <possibleNumberPattern>\d{9}</possibleNumberPattern> 35 </generalDesc> 36 <uan> 37 <nationalNumberPattern>600\d{6}</nationalNumberPattern> 38 <exampleNumber>600123456</exampleNumber> 39 </uan> 40 </territory> 41 42 <!-- Angola --> 43 <!-- This country has been coopted to test the case of a national prefix with a non-numeric 44 symbol in it. It is also useful since it has no national prefix formatting rule. --> 45 <territory id="AO" countryCode="244" internationalPrefix="00" nationalPrefix="0~0"> 46 <availableFormats> 47 <numberFormat pattern="(\d{3})(\d{3})(\d{3})"> 48 <format>$1 $2 $3</format> 49 </numberFormat> 50 </availableFormats> 51 <generalDesc> 52 <nationalNumberPattern>[29]\d{8}</nationalNumberPattern> 53 <possibleNumberPattern>\d{9}</possibleNumberPattern> 54 </generalDesc> 55 <fixedLine> 56 <nationalNumberPattern>2\d(?:[26-9]\d|\d[26-9])\d{5}</nationalNumberPattern> 57 <exampleNumber>222123456</exampleNumber> 58 </fixedLine> 59 <mobile> 60 <!-- Expanded the 92 prefix possibilities to match numbers found online. --> 61 <nationalNumberPattern>9[1-3]\d{7}</nationalNumberPattern> 62 <exampleNumber>923123456</exampleNumber> 63 </mobile> 64 </territory> 65 66 <!-- Argentina --> 67 <territory id="AR" countryCode="54" internationalPrefix="00" 68 nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG" 69 nationalPrefixForParsing="0(?:(11|343|3715)15)?" 70 nationalPrefixTransformRule="9$1"> 71 <!-- Note in nationalPrefixForParsing, the areacode (such as 11, 343, etc.), when present in 72 front of carrier selection code 15, is captured to replace $1 in 73 nationalPrefixTransformRule --> 74 <availableFormats> 75 <numberFormat pattern="(\d{2})(\d{4})(\d{4})"> 76 <leadingDigits>11</leadingDigits> 77 <format>$1 $2-$3</format> 78 </numberFormat> 79 <numberFormat pattern="(\d{4})(\d{2})(\d{4})"> 80 <leadingDigits>1[02-9]|[23]</leadingDigits> 81 <format>$1 $2-$3</format> 82 </numberFormat> 83 <numberFormat pattern="(9)(11)(\d{4})(\d{4})"> 84 <leadingDigits>911</leadingDigits> 85 <format>$2 15 $3-$4</format> 86 <intlFormat>$1 $2 $3 $4</intlFormat> 87 </numberFormat> 88 <numberFormat pattern="(9)(\d{4})(\d{2})(\d{4})" 89 carrierCodeFormattingRule="$NP$FG $CC"> 90 <leadingDigits>9(?:1[02-9]|[23])</leadingDigits> 91 <format>$2 $3-$4</format> 92 <intlFormat>$1 $2 $3 $4</intlFormat> 93 </numberFormat> 94 <numberFormat pattern="(\d{3})(\d{3})(\d{4})"> 95 <leadingDigits>[68]</leadingDigits> 96 <format>$1-$2-$3</format> 97 </numberFormat> 98 </availableFormats> 99 <generalDesc> 100 <nationalNumberPattern>[1-3689]\d{9,10}</nationalNumberPattern> 101 <possibleNumberPattern>\d{6,11}</possibleNumberPattern> 102 </generalDesc> 103 <fixedLine> 104 <nationalNumberPattern>[1-3]\d{9}</nationalNumberPattern> 105 <possibleNumberPattern>\d{6,10}</possibleNumberPattern> 106 </fixedLine> 107 <mobile> 108 <nationalNumberPattern>9\d{10}|[1-3]\d{9}</nationalNumberPattern> 109 <possibleNumberPattern>\d{10,11}</possibleNumberPattern> 110 </mobile> 111 <tollFree> 112 <nationalNumberPattern>80\d{8}</nationalNumberPattern> 113 <possibleNumberPattern>\d{10}</possibleNumberPattern> 114 </tollFree> 115 <premiumRate> 116 <nationalNumberPattern>6(0\d|10)\d{7}</nationalNumberPattern> 117 <possibleNumberPattern>\d{10}</possibleNumberPattern> 118 </premiumRate> 119 </territory> 120 121 <!-- Australia --> 122 <territory id="AU" countryCode="61" internationalPrefix="001[12]" 123 nationalPrefix="0" preferredInternationalPrefix="0011" 124 nationalPrefixFormattingRule="$NP$FG"> 125 <availableFormats> 126 <numberFormat nationalPrefixFormattingRule="$FG" 127 pattern="(\d{4})(\d{3})(\d{3})" > 128 <leadingDigits>1</leadingDigits> 129 <format>$1 $2 $3</format> 130 </numberFormat> 131 <numberFormat pattern="(\d{1})(\d{4})(\d{4})"> 132 <leadingDigits>[2-478]</leadingDigits> 133 <format>$1 $2 $3</format> 134 </numberFormat> 135 </availableFormats> 136 <generalDesc > 137 <nationalNumberPattern>[1-578]\d{4,14}</nationalNumberPattern> 138 <possibleNumberPattern>\d{5,15}</possibleNumberPattern> 139 </generalDesc> 140 <fixedLine> 141 <nationalNumberPattern>[2378]\d{8}</nationalNumberPattern> 142 <possibleNumberPattern>\d{9}</possibleNumberPattern> 143 </fixedLine> 144 <mobile> 145 <nationalNumberPattern>4\d{8}</nationalNumberPattern> 146 <possibleNumberPattern>\d{9}</possibleNumberPattern> 147 </mobile> 148 <tollFree> 149 <nationalNumberPattern>1800\d{6}</nationalNumberPattern> 150 <possibleNumberPattern>\d{10}</possibleNumberPattern> 151 </tollFree> 152 <premiumRate> 153 <nationalNumberPattern>190[0126]\d{6}</nationalNumberPattern> 154 <possibleNumberPattern>\d{10}</possibleNumberPattern> 155 </premiumRate> 156 </territory> 157 158 <!-- Brazil --> 159 <territory id="BR" countryCode="55" internationalPrefix="0014" nationalPrefix="0"> 160 <emergency> 161 <nationalNumberPattern> 162 19[023]| 163 911 164 </nationalNumberPattern> 165 <possibleNumberPattern>\d{3}</possibleNumberPattern> 166 <exampleNumber>190</exampleNumber> 167 </emergency> 168 </territory> 169 170 <!-- Bahamas --> 171 <territory id="BS" countryCode="1" internationalPrefix="011" 172 nationalPrefix="1"> 173 <generalDesc> 174 <nationalNumberPattern>(242|8(00|66|77|88)|900)\d{7}</nationalNumberPattern> 175 <possibleNumberPattern>\d{7,10}</possibleNumberPattern> 176 </generalDesc> 177 <fixedLine> 178 <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> 179 </fixedLine> 180 <mobile> 181 <nationalNumberPattern>242(357|359|457|557)\d{4}</nationalNumberPattern> 182 <possibleNumberPattern>\d{10}</possibleNumberPattern> 183 </mobile> 184 <tollFree> 185 <nationalNumberPattern>8(00|66|77|88)\d{7}</nationalNumberPattern> 186 <possibleNumberPattern>\d{10}</possibleNumberPattern> 187 </tollFree> 188 <premiumRate> 189 <nationalNumberPattern>900\d{7}</nationalNumberPattern> 190 <possibleNumberPattern>\d{10}</possibleNumberPattern> 191 </premiumRate> 192 </territory> 193 194 <!-- Belarus --> 195 <!-- This country has been coopted to test the case of a national prefix formatting rule with a 196 space in it. --> 197 <territory id="BY" countryCode="375" internationalPrefix="810" nationalPrefix="8" 198 nationalPrefixForParsing="80?|99999" nationalPrefixFormattingRule="$NP $FG"> 199 <availableFormats> 200 <!-- We make some bogus formatting templates that differ only in length to check that 201 switching formatting patterns works as expected.--> 202 <numberFormat pattern="(\d{4})"> 203 <leadingDigits>[1-8]</leadingDigits> 204 <format>$1</format> 205 </numberFormat> 206 <!-- This pattern has an override to remove the space after the national prefix. --> 207 <numberFormat pattern="(\d{2})(\d{3})" nationalPrefixFormattingRule="$NP$FG"> 208 <leadingDigits>[1-8]</leadingDigits> 209 <format>$1 $2</format> 210 </numberFormat> 211 <numberFormat pattern="(\d{3})(\d{3})"> 212 <leadingDigits>[1-8]</leadingDigits> 213 <format>$1 $2</format> 214 </numberFormat> 215 </availableFormats> 216 <generalDesc> 217 <!-- This numbering plan is completely bogus, but is used to test the AYTF logic. For that 218 reason, it is kept very simple. --> 219 <nationalNumberPattern>[1-9]\d{5}</nationalNumberPattern> 220 <possibleNumberPattern>\d{6}</possibleNumberPattern> 221 </generalDesc> 222 <fixedLine> 223 <exampleNumber>112345</exampleNumber> 224 </fixedLine> 225 </territory> 226 227 <!-- Germany --> 228 <territory id="DE" countryCode="49" internationalPrefix="00" 229 nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> 230 <availableFormats> 231 <numberFormat pattern="(\d{3})(\d{3,8})"> 232 <leadingDigits>2|3[3-9]|906|[4-9][1-9]1</leadingDigits> 233 <format>$1 $2</format> 234 </numberFormat> 235 <numberFormat pattern="(\d{2})(\d{4,9})"> 236 <leadingDigits>[34]0|[68]9</leadingDigits> 237 <format>$1/$2</format> 238 </numberFormat> 239 <!-- Extra fictional pattern for shorter numbers with the same prefixes as the following 240 pattern, to illustrate the problem the AYTF has with real patterns that share this 241 property. --> 242 <numberFormat pattern="([4-9]\d)(\d{2})"> 243 <leadingDigits>[4-9]</leadingDigits> 244 <leadingDigits>[4-6]|[7-9](?:\d[1-9]|[1-9]\d)</leadingDigits> 245 <format>$1 $2</format> 246 </numberFormat> 247 <numberFormat pattern="([4-9]\d{3})(\d{2,7})"> 248 <leadingDigits>[4-9]</leadingDigits> 249 <leadingDigits>[4-6]|[7-9](?:\d[1-9]|[1-9]\d)</leadingDigits> 250 <format>$1 $2</format> 251 </numberFormat> 252 <numberFormat pattern="(\d{3})(\d{1})(\d{6})"> 253 <leadingDigits>800</leadingDigits> 254 <format>$1 $2 $3</format> 255 </numberFormat> 256 <numberFormat pattern="(\d{3})(\d{3,4})(\d{4})"> 257 <leadingDigits>900</leadingDigits> 258 <format>$1 $2 $3</format> 259 </numberFormat> 260 </availableFormats> 261 <generalDesc> 262 <nationalNumberPattern>\d{4,14}</nationalNumberPattern> 263 <possibleNumberPattern>\d{2,14}</possibleNumberPattern> 264 </generalDesc> 265 <fixedLine> 266 <nationalNumberPattern>(?:[24-6]\d{2}|3[03-9]\d|[789](?:[1-9]\d|0[2-9]))\d{1,8}</nationalNumberPattern> 267 <exampleNumber>30123456</exampleNumber> 268 </fixedLine> 269 <mobile> 270 <nationalNumberPattern>1(5\d{9}|7\d{8}|6[02]\d{8}|63\d{7})</nationalNumberPattern> 271 <possibleNumberPattern>\d{10,11}</possibleNumberPattern> 272 </mobile> 273 <tollFree> 274 <nationalNumberPattern>800\d{7}</nationalNumberPattern> 275 <possibleNumberPattern>\d{10}</possibleNumberPattern> 276 </tollFree> 277 <premiumRate> 278 <nationalNumberPattern>900([135]\d{6}|9\d{7})</nationalNumberPattern> 279 <possibleNumberPattern>\d{10,11}</possibleNumberPattern> 280 </premiumRate> 281 </territory> 282 283 <!-- United Kingdom --> 284 <territory id="GB" countryCode="44" internationalPrefix="00" 285 nationalPrefix="0" nationalPrefixFormattingRule="($NP$FG)"> 286 <availableFormats> 287 <numberFormat pattern="(\d{2})(\d{4})(\d{4})"> 288 <leadingDigits>[1-59]|[78]0</leadingDigits> 289 <format>$1 $2 $3</format> 290 </numberFormat> 291 <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{3})"> 292 <leadingDigits>6</leadingDigits> 293 <format>$1 $2 $3 $4</format> 294 </numberFormat> 295 <numberFormat pattern="(\d{4})(\d{3})(\d{3})"> 296 <leadingDigits>7[1-57-9]</leadingDigits> 297 <format>$1 $2 $3</format> 298 </numberFormat> 299 <numberFormat pattern="(\d{3})(\d{3})(\d{4})"> 300 <leadingDigits>8[47]</leadingDigits> 301 <format>$1 $2 $3</format> 302 </numberFormat> 303 </availableFormats> 304 <generalDesc> 305 <nationalNumberPattern>\d{10}</nationalNumberPattern> 306 <possibleNumberPattern>\d{6,10}</possibleNumberPattern> 307 </generalDesc> 308 <fixedLine> 309 <nationalNumberPattern>[1-6]\d{9}</nationalNumberPattern> 310 </fixedLine> 311 <mobile> 312 <nationalNumberPattern>7[1-57-9]\d{8}</nationalNumberPattern> 313 <possibleNumberPattern>\d{10}</possibleNumberPattern> 314 </mobile> 315 <tollFree> 316 <nationalNumberPattern>80\d{8}</nationalNumberPattern> 317 <possibleNumberPattern>\d{10}</possibleNumberPattern> 318 </tollFree> 319 <premiumRate> 320 <nationalNumberPattern>9[018]\d{8}</nationalNumberPattern> 321 <possibleNumberPattern>\d{10}</possibleNumberPattern> 322 </premiumRate> 323 <sharedCost> 324 <nationalNumberPattern>8(?:4[3-5]|7[0-2])\d{7}</nationalNumberPattern> 325 <possibleNumberPattern>\d{10}</possibleNumberPattern> 326 </sharedCost> 327 <voip> 328 <nationalNumberPattern>56\d{8}</nationalNumberPattern> 329 <possibleNumberPattern>\d{10}</possibleNumberPattern> 330 </voip> 331 <personalNumber> 332 <nationalNumberPattern>70\d{8}</nationalNumberPattern> 333 <possibleNumberPattern>\d{10}</possibleNumberPattern> 334 </personalNumber> 335 </territory> 336 337 <!-- Italy --> 338 <!-- http://en.wikipedia.org/wiki/%2B39 --> 339 <territory id="IT" countryCode="39" internationalPrefix="00" leadingZeroPossible="true"> 340 <availableFormats> 341 <numberFormat pattern="(\d{2})(\d{4})(\d{4})"> 342 <leadingDigits>0[26]</leadingDigits> 343 <format>$1 $2 $3</format> 344 </numberFormat> 345 <numberFormat pattern="(\d{3})(\d{4})(\d{3,4})"> 346 <leadingDigits>0[13-57-9]</leadingDigits> 347 <format>$1 $2 $3</format> 348 </numberFormat> 349 <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})"> 350 <leadingDigits>3</leadingDigits> 351 <format>$1 $2 $3</format> 352 </numberFormat> 353 <numberFormat pattern="(\d{3})(\d{3,6})"> 354 <leadingDigits>8</leadingDigits> 355 <format>$1 $2</format> 356 </numberFormat> 357 </availableFormats> 358 <generalDesc> 359 <nationalNumberPattern>[0389]\d{5,10}</nationalNumberPattern> 360 <possibleNumberPattern>\d{6,11}</possibleNumberPattern> 361 </generalDesc> 362 <fixedLine> 363 <nationalNumberPattern>0\d{9,10}</nationalNumberPattern> 364 <possibleNumberPattern>\d{10,11}</possibleNumberPattern> 365 </fixedLine> 366 <mobile> 367 <nationalNumberPattern>3\d{8,9}</nationalNumberPattern> 368 <possibleNumberPattern>\d{9,10}</possibleNumberPattern> 369 </mobile> 370 <tollFree> 371 <nationalNumberPattern>80(?:0\d{6}|3\d{3})</nationalNumberPattern> 372 <possibleNumberPattern>\d{6,9}</possibleNumberPattern> 373 </tollFree> 374 <premiumRate> 375 <nationalNumberPattern>89(?:2\d{3}|9\d{6})</nationalNumberPattern> 376 <possibleNumberPattern>\d{6,9}</possibleNumberPattern> 377 </premiumRate> 378 </territory> 379 380 <!-- Japan --> 381 <!-- The metadata here is added to unit test AsYouTypeFormatter for JP, which requires switching 382 patterns as digits beyond the third one are entered. As a result, only a few fake 383 formatting rules are added. --> 384 <territory id="JP" countryCode="81" internationalPrefix="010" 385 nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG" leadingZeroPossible="true"> 386 <availableFormats> 387 <numberFormat pattern="(\d{2})(\d{4})(\d{4})"> 388 <leadingDigits>[57-9]0</leadingDigits> 389 <format>$1 $2 $3</format> 390 </numberFormat> 391 <numberFormat pattern="(\d{2})(\d{2})(\d{3})(\d{4})"> 392 <leadingDigits>[57-9]0</leadingDigits> 393 <format>$1 $2 $3 $4</format> 394 </numberFormat> 395 <numberFormat pattern="(\d{2})(\d{3})(\d{4})"> 396 <leadingDigits>111|222|333</leadingDigits> 397 <leadingDigits>(?:111|222|333)1</leadingDigits> 398 <leadingDigits>(?:111|222|333)11</leadingDigits> 399 <format>$1 $2 $3</format> 400 </numberFormat> 401 <numberFormat pattern="(\d{4})(\d)(\d{4})"> 402 <leadingDigits>222|333</leadingDigits> 403 <leadingDigits>2221|3332</leadingDigits> 404 <leadingDigits>22212|3332</leadingDigits> 405 <leadingDigits>222120|3332</leadingDigits> 406 <format>$1 $2 $3</format> 407 </numberFormat> 408 <numberFormat pattern="(\d{3})(\d{2})(\d{4})"> 409 <leadingDigits>[23]</leadingDigits> 410 <format>$1 $2 $3</format> 411 </numberFormat> 412 <numberFormat pattern="(\d{3})(\d{4})"> 413 <leadingDigits>077</leadingDigits> 414 <format>$1-$2</format> 415 </numberFormat> 416 <!-- The following numberFormat is added to test that the format containing the star sign is 417 not used by the AYTF. --> 418 <numberFormat nationalPrefixFormattingRule="$FG" pattern="(\d{4})"> 419 <leadingDigits>[23]</leadingDigits> 420 <format>*$1</format> 421 </numberFormat> 422 </availableFormats> 423 <noInternationalDialling> 424 <nationalNumberPattern>[23]\d{3}</nationalNumberPattern> 425 <possibleNumberPattern>\d{4}</possibleNumberPattern> 426 </noInternationalDialling> 427 <generalDesc> 428 <nationalNumberPattern>07\d{5}|[1-357-9]\d{3,10}</nationalNumberPattern> 429 <possibleNumberPattern>\d{4,11}</possibleNumberPattern> 430 </generalDesc> 431 <tollFree> 432 <nationalNumberPattern>0777[01]\d{2}</nationalNumberPattern> 433 <possibleNumberPattern>\d{7}</possibleNumberPattern> 434 <exampleNumber>0777012</exampleNumber> 435 </tollFree> 436 </territory> 437 438 <!-- Korea (Rep. of) --> 439 <!-- http://www.itu.int/oth/T0202000072/en --> 440 <!-- http://en.wikipedia.org/wiki/%2B82 --> 441 <!-- http://www.kcc.go.kr/user.do?mode=view&page=P02030300&dc=K02030300&boardId=1074&boardSeq=2349 --> 442 <!-- http://www.kcc.go.kr/user.do?mode=view&page=P02030300&dc=K02030300&boardId=1074&boardSeq=2240 --> 443 <!-- http://www.telecentro.co.kr/sub/index.php?job=detail&ebcf_id=faq&page=1&mid=0503&eb_seq=36 --> 444 <!-- Exceptions : 445 internationalPrefix 446 0031, 0033, 0071, 0073 - Special services of KT and DACOM, ignorable 447 nationalPrefix 448 1[4-6]XX-YYYY - Country-wide common number services, display as it is without hyphens --> 449 <territory id="KR" countryCode="82" internationalPrefix="00(?:[124-68]|[37]\d{2})" 450 nationalPrefix="0" nationalPrefixForParsing="0(8[1-46-8]|85\d{2})?" 451 nationalPrefixFormattingRule="$NP$FG"> 452 <availableFormats> 453 <numberFormat pattern="(\d{2})(\d{4})(\d{4})"> 454 <leadingDigits>1(?:0|1[19]|[69]9|5[458])|[57]0</leadingDigits> 455 <leadingDigits>1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0</leadingDigits> 456 <format>$1-$2-$3</format> 457 </numberFormat> 458 <numberFormat pattern="(\d{2})(\d{3})(\d{4})"> 459 <leadingDigits>1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][2-9]</leadingDigits> 460 <leadingDigits>1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][2-9]</leadingDigits> 461 <format>$1-$2-$3</format> 462 </numberFormat> 463 <numberFormat pattern="(\d{3})(\d)(\d{4})"> 464 <leadingDigits>131</leadingDigits> 465 <leadingDigits>1312</leadingDigits> 466 <format>$1-$2-$3</format> 467 </numberFormat> 468 <numberFormat pattern="(\d{3})(\d{2})(\d{4})"> 469 <leadingDigits>131</leadingDigits> 470 <leadingDigits>131[13-9]</leadingDigits> 471 <format>$1-$2-$3</format> 472 </numberFormat> 473 <numberFormat pattern="(\d{3})(\d{3})(\d{4})"> 474 <leadingDigits>13[2-9]</leadingDigits> 475 <format>$1-$2-$3</format> 476 </numberFormat> 477 <numberFormat pattern="(\d{2})(\d{2})(\d{3})(\d{4})"> 478 <leadingDigits>30</leadingDigits> 479 <format>$1-$2-$3-$4</format> 480 </numberFormat> 481 <numberFormat pattern="(\d)(\d{4})(\d{4})"> 482 <leadingDigits>2(?:[26]|3[0-467])</leadingDigits> 483 <leadingDigits>2(?:[26]|3(?:01|1[45]|2[17-9]|39|4|6[67]|7[078]))</leadingDigits> 484 <format>$1-$2-$3</format> 485 </numberFormat> 486 <numberFormat pattern="(\d)(\d{3})(\d{4})"> 487 <leadingDigits>2(?:3[0-35-9]|[457-9])</leadingDigits> 488 <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> 489 <format>$1-$2-$3</format> 490 </numberFormat> 491 <numberFormat pattern="(\d)(\d{3})"> 492 <leadingDigits>21[0-46-9]</leadingDigits> 493 <leadingDigits>21(?:[0-247-9]|3[124]|6[1269])</leadingDigits> 494 <format>$1-$2</format> 495 </numberFormat> 496 <numberFormat pattern="(\d)(\d{4})"> 497 <leadingDigits>21[36]</leadingDigits> 498 <leadingDigits>21(?:3[035-9]|6[03-578])</leadingDigits> 499 <format>$1-$2</format> 500 </numberFormat> 501 <numberFormat pattern="(\d{2})(\d{3})"> 502 <leadingDigits>[3-6][1-9]1</leadingDigits> 503 <leadingDigits>[3-6][1-9]1(?:[0-46-9])</leadingDigits> 504 <leadingDigits>[3-6][1-9]1(?:[0-247-9]|3[124]|6[1269])</leadingDigits> 505 <format>$1-$2</format> 506 </numberFormat> 507 <numberFormat pattern="(\d{2})(\d{4})"> 508 <leadingDigits>[3-6][1-9]1</leadingDigits> 509 <leadingDigits>[3-6][1-9]1[36]</leadingDigits> 510 <leadingDigits>[3-6][1-9]1(?:3[035-9]|6[03-578])</leadingDigits> 511 <format>$1-$2</format> 512 </numberFormat> 513 </availableFormats> 514 <generalDesc> 515 <nationalNumberPattern>[1-7]\d{3,9}|8\d{8}</nationalNumberPattern> 516 <possibleNumberPattern>\d{4,10}</possibleNumberPattern> 517 </generalDesc> 518 <fixedLine> 519 <nationalNumberPattern>(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\d{2,3}|[2-9]\d{6,7})</nationalNumberPattern> 520 <possibleNumberPattern>\d{4,10}</possibleNumberPattern> 521 <exampleNumber>22123456</exampleNumber> 522 </fixedLine> 523 <mobile> 524 <nationalNumberPattern>1[0-25-9]\d{7,8}</nationalNumberPattern> 525 <possibleNumberPattern>\d{9,10}</possibleNumberPattern> 526 <exampleNumber>1023456789</exampleNumber> 527 </mobile> 528 <tollFree> 529 <nationalNumberPattern>80\d{7}</nationalNumberPattern> 530 <possibleNumberPattern>\d{9}</possibleNumberPattern> 531 <exampleNumber>801234567</exampleNumber> 532 </tollFree> 533 <premiumRate> 534 <nationalNumberPattern>60[2-9]\d{6}</nationalNumberPattern> 535 <possibleNumberPattern>\d{9}</possibleNumberPattern> 536 <exampleNumber>602345678</exampleNumber> 537 </premiumRate> 538 <personalNumber> 539 <nationalNumberPattern>50\d{8}</nationalNumberPattern> 540 <possibleNumberPattern>\d{10}</possibleNumberPattern> 541 <exampleNumber>5012345678</exampleNumber> 542 </personalNumber> 543 <voip> 544 <nationalNumberPattern>70\d{8}</nationalNumberPattern> 545 <possibleNumberPattern>\d{10}</possibleNumberPattern> 546 <exampleNumber>7012345678</exampleNumber> 547 </voip> 548 </territory> 549 550 <!-- Mexico --> 551 <territory id="MX" countryCode="52" internationalPrefix="00" 552 nationalPrefix="01" nationalPrefixForParsing="01|04[45](\d{10})" 553 nationalPrefixTransformRule="1$1" nationalPrefixFormattingRule="$NP $FG" 554 nationalPrefixOptionalWhenFormatting="true"> 555 <availableFormats> 556 <numberFormat pattern="(\d{3})(\d{3})(\d{4})"> 557 <leadingDigits>[89]00</leadingDigits> 558 <format>$1 $2 $3</format> 559 </numberFormat> 560 <numberFormat pattern="(\d{2})(\d{4})(\d{4})"> 561 <leadingDigits>33|55|81</leadingDigits> 562 <format>$1 $2 $3</format> 563 </numberFormat> 564 <numberFormat pattern="(\d{3})(\d{3})(\d{4})"> 565 <leadingDigits>[2467]|3[0-24-9]|5[0-46-9]|8[2-9]|9[1-9]</leadingDigits> 566 <format>$1 $2 $3</format> 567 </numberFormat> 568 <numberFormat nationalPrefixFormattingRule="$FG" pattern="(1)(\d{2})(\d{4})(\d{4})"> 569 <leadingDigits>1(?:33|55|81)</leadingDigits> 570 <format>045 $2 $3 $4</format> 571 <intlFormat>$1 $2 $3 $4</intlFormat> 572 </numberFormat> 573 <numberFormat nationalPrefixFormattingRule="$FG" pattern="(1)(\d{3})(\d{3})(\d{4})"> 574 <leadingDigits>1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])</leadingDigits> 575 <format>045 $2 $3 $4</format> 576 <intlFormat>$1 $2 $3 $4</intlFormat> 577 </numberFormat> 578 </availableFormats> 579 <generalDesc> 580 <nationalNumberPattern>[1-9]\d{9,10}</nationalNumberPattern> 581 <possibleNumberPattern>\d{7,11}</possibleNumberPattern> 582 </generalDesc> 583 <fixedLine> 584 <nationalNumberPattern>[2-9]\d{9}</nationalNumberPattern> 585 <possibleNumberPattern>\d{7,10}</possibleNumberPattern> 586 </fixedLine> 587 <mobile> 588 <nationalNumberPattern>1\d{10}</nationalNumberPattern> 589 <possibleNumberPattern>\d{11}</possibleNumberPattern> 590 </mobile> 591 <tollFree> 592 <nationalNumberPattern>800\d{7}</nationalNumberPattern> 593 <possibleNumberPattern>\d{10}</possibleNumberPattern> 594 </tollFree> 595 <premiumRate> 596 <nationalNumberPattern>900\d{7}</nationalNumberPattern> 597 <possibleNumberPattern>\d{10}</possibleNumberPattern> 598 </premiumRate> 599 </territory> 600 601 <!-- New Zealand --> 602 <territory id="NZ" countryCode="64" internationalPrefix="00" 603 nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> 604 <availableFormats> 605 <numberFormat pattern="(\d)(\d{3})(\d{4})"> 606 <leadingDigits>24|[34679]</leadingDigits> 607 <format>$1-$2 $3</format> 608 </numberFormat> 609 <numberFormat pattern="(\d)(\d{3})(\d{3,5})"> 610 <leadingDigits>2[179]</leadingDigits> 611 <format>$1-$2 $3</format> 612 </numberFormat> 613 <numberFormat pattern="(\d{3})(\d{3})(\d{3,4})"> 614 <leadingDigits>[89]</leadingDigits> 615 <format>$1 $2 $3</format> 616 </numberFormat> 617 </availableFormats> 618 <generalDesc> 619 <nationalNumberPattern> 620 [289]\d{7,9}| 621 [3-7]\d{7} 622 </nationalNumberPattern> 623 <possibleNumberPattern>\d{7,10}</possibleNumberPattern> 624 </generalDesc> 625 <fixedLine> 626 <nationalNumberPattern>24099\d{3}|(?:3[2-79]|[479][2-689]|6[235-9])\d{6}</nationalNumberPattern> 627 <possibleNumberPattern>\d{7,8}</possibleNumberPattern> 628 </fixedLine> 629 <mobile> 630 <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> 631 <possibleNumberPattern>\d{8,10}</possibleNumberPattern> 632 </mobile> 633 <tollFree> 634 <nationalNumberPattern>800\d{6,7}</nationalNumberPattern> 635 <possibleNumberPattern>\d{9,10}</possibleNumberPattern> 636 </tollFree> 637 <premiumRate> 638 <nationalNumberPattern>900\d{6,7}</nationalNumberPattern> 639 <possibleNumberPattern>\d{9,10}</possibleNumberPattern> 640 </premiumRate> 641 </territory> 642 643 <!-- Poland --> 644 <!-- http://en.wikipedia.org/wiki/%2B48 --> 645 <territory id="PL" countryCode="48" internationalPrefix="00" 646 nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> 647 <availableFormats> 648 <numberFormat pattern="(\d{2})(\d{3})(\d{2})(\d{2})"> 649 <format>$1 $2 $3 $4</format> 650 </numberFormat> 651 </availableFormats> 652 <generalDesc> 653 <nationalNumberPattern>[1-9]\d{8}</nationalNumberPattern> 654 <possibleNumberPattern>\d{9}</possibleNumberPattern> 655 </generalDesc> 656 <mobile> 657 <nationalNumberPattern>(?:5[01]|6[069]|7[289]|88)\d{7}</nationalNumberPattern> 658 </mobile> 659 <tollFree> 660 <nationalNumberPattern>800\d{6}</nationalNumberPattern> 661 </tollFree> 662 <premiumRate> 663 <nationalNumberPattern>70\d{7}</nationalNumberPattern> 664 </premiumRate> 665 </territory> 666 667 <!-- Runion (French Departments and Territories in the Indian Ocean) --> 668 <!-- Note this shares the same country code as La Mayotte and French 669 Southern Territories, and the formatting patterns here are used by all of 670 them. This is present to test leadingDigits. --> 671 <territory id="RE" countryCode="262" leadingDigits="262|6(?:9[23]|47)|8" 672 internationalPrefix="00" nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> 673 <availableFormats> 674 <numberFormat pattern="([268]\d{2})(\d{2})(\d{2})(\d{2})"> 675 <format>$1 $2 $3 $4</format> 676 </numberFormat> 677 </availableFormats> 678 <generalDesc> 679 <nationalNumberPattern>[268]\d{8}</nationalNumberPattern> 680 <possibleNumberPattern>\d{9}</possibleNumberPattern> 681 </generalDesc> 682 <fixedLine> 683 <!-- 0876 numbers are mentioned in the plan, but none in use can be 684 found. --> 685 <nationalNumberPattern>262\d{6}</nationalNumberPattern> 686 <exampleNumber>262161234</exampleNumber> 687 </fixedLine> 688 <mobile> 689 <nationalNumberPattern>6(?:9[23]|47)\d{6}</nationalNumberPattern> 690 <possibleNumberPattern>\d{9}</possibleNumberPattern> 691 <exampleNumber>692123456</exampleNumber> 692 </mobile> 693 <!-- 08* Numbers in Runion are the same as those valid in France. --> 694 <tollFree> 695 <nationalNumberPattern>80\d{7}</nationalNumberPattern> 696 <exampleNumber>801234567</exampleNumber> 697 </tollFree> 698 <premiumRate> 699 <nationalNumberPattern>8(?:1[01]|2[0156]|84|9[0-37-9])\d{6}</nationalNumberPattern> 700 <exampleNumber>810123456</exampleNumber> 701 </premiumRate> 702 </territory> 703 704 <!-- Singapore --> 705 <!-- http://www.ida.gov.sg/policies%20and%20regulation/20060508120124.aspx --> 706 <!-- For testing the AYTF with long NDDs, "777777" is added as a possible national prefix. --> 707 <territory id="SG" countryCode="65" internationalPrefix="0[0-3][0-9]" 708 nationalPrefixForParsing="777777"> 709 <availableFormats> 710 <numberFormat pattern="(\d{4})(\d{4})"> 711 <leadingDigits>[369]|8[1-9]</leadingDigits> 712 <format>$1 $2</format> 713 </numberFormat> 714 <numberFormat pattern="(\d{4})(\d{3})(\d{4})"> 715 <leadingDigits>1[89]</leadingDigits> 716 <format>$1 $2 $3</format> 717 </numberFormat> 718 <numberFormat pattern="(\d{3})(\d{3})(\d{4})"> 719 <leadingDigits>800</leadingDigits> 720 <format>$1 $2 $3</format> 721 </numberFormat> 722 </availableFormats> 723 <generalDesc> 724 <nationalNumberPattern>[13689]\d{7,10}</nationalNumberPattern> 725 <!-- This specific pattern with the | is used to unit-test IsPossibleNumberWithReason. --> 726 <possibleNumberPattern> 727 \d{8}| 728 \d{10,11} 729 </possibleNumberPattern> 730 </generalDesc> 731 <fixedLine> 732 <nationalNumberPattern>[36]\d{7}</nationalNumberPattern> 733 <possibleNumberPattern>\d{8}</possibleNumberPattern> 734 </fixedLine> 735 <mobile> 736 <nationalNumberPattern>[89]\d{7}</nationalNumberPattern> 737 <possibleNumberPattern>\d{8}</possibleNumberPattern> 738 </mobile> 739 <tollFree> 740 <nationalNumberPattern>1?800\d{7}</nationalNumberPattern> 741 <possibleNumberPattern>\d{10,11}</possibleNumberPattern> 742 </tollFree> 743 <premiumRate> 744 <nationalNumberPattern>1900\d{7}</nationalNumberPattern> 745 <possibleNumberPattern>\d{11}</possibleNumberPattern> 746 </premiumRate> 747 </territory> 748 749 <!-- United States --> 750 <!-- http://www.nanpa.com/reports/reports_npa.html --> 751 <!-- For testing purposes, numbers starting with 24 are not considered US numbers.--> 752 <territory id="US" countryCode="1" internationalPrefix="011" 753 preferredExtnPrefix=" extn. " nationalPrefix="1" 754 mainCountryForCode="true" nationalPrefixOptionalWhenFormatting="true"> 755 <availableFormats> 756 <numberFormat pattern="(\d{3})(\d{4})"> 757 <format>$1 $2</format> 758 <intlFormat>NA</intlFormat> 759 </numberFormat> 760 <numberFormat pattern="(\d{3})(\d{3})(\d{4})"> 761 <format>$1 $2 $3</format> 762 </numberFormat> 763 </availableFormats> 764 <generalDesc> 765 <!-- Numbers beginning with 7 are excluded for testing purposes only. --> 766 <nationalNumberPattern>[13-689]\d{9}|2[0-35-9]\d{8}</nationalNumberPattern> 767 <possibleNumberPattern>\d{7}(?:\d{3})?</possibleNumberPattern> 768 <exampleNumber>1234567890</exampleNumber> 769 </generalDesc> 770 <noInternationalDialling> 771 <!-- This range is added for testing purposes only. --> 772 <nationalNumberPattern>800\d{7}</nationalNumberPattern> 773 <possibleNumberPattern>\d{10}</possibleNumberPattern> 774 </noInternationalDialling> 775 <tollFree> 776 <nationalNumberPattern>8(?:00|66|77|88)\d{7}</nationalNumberPattern> 777 <possibleNumberPattern>\d{10}</possibleNumberPattern> 778 </tollFree> 779 <premiumRate> 780 <nationalNumberPattern>900\d{7}</nationalNumberPattern> 781 <possibleNumberPattern>\d{10}</possibleNumberPattern> 782 </premiumRate> 783 <emergency> 784 <nationalNumberPattern> 785 119| 786 911 787 </nationalNumberPattern> 788 <possibleNumberPattern>\d{3}</possibleNumberPattern> 789 <exampleNumber>911</exampleNumber> 790 </emergency> 791 </territory> 792 793 <!-- Mayotte --> 794 <territory id="YT" countryCode="262" leadingDigits="269|639" 795 internationalPrefix="00" nationalPrefix="0" nationalPrefixFormattingRule="$NP$FG"> 796 <!-- Formatting as per La Runion. --> 797 <generalDesc> 798 <nationalNumberPattern>[268]\d{8}</nationalNumberPattern> 799 <possibleNumberPattern>\d{9}</possibleNumberPattern> 800 </generalDesc> 801 <fixedLine> 802 <nationalNumberPattern>2696[0-4]\d{4}</nationalNumberPattern> 803 <exampleNumber>269601234</exampleNumber> 804 </fixedLine> 805 <mobile> 806 <nationalNumberPattern>639\d{6}</nationalNumberPattern> 807 <exampleNumber>639123456</exampleNumber> 808 </mobile> 809 <!-- Same as in France. --> 810 <tollFree> 811 <nationalNumberPattern>80\d{7}</nationalNumberPattern> 812 <exampleNumber>801234567</exampleNumber> 813 </tollFree> 814 </territory> 815 816 <!-- International Toll Free numbers --> 817 <territory id="001" countryCode="800" leadingZeroPossible="true"> 818 <availableFormats> 819 <numberFormat pattern="(\d{4})(\d{4})"> 820 <format>$1 $2</format> 821 </numberFormat> 822 </availableFormats> 823 <generalDesc> 824 <nationalNumberPattern>\d{8}</nationalNumberPattern> 825 <possibleNumberPattern>\d{8}</possibleNumberPattern> 826 <exampleNumber>12345678</exampleNumber> 827 </generalDesc> 828 <fixedLine> 829 <nationalNumberPattern>NA</nationalNumberPattern> 830 <possibleNumberPattern>NA</possibleNumberPattern> 831 </fixedLine> 832 <mobile> 833 <nationalNumberPattern>NA</nationalNumberPattern> 834 <possibleNumberPattern>NA</possibleNumberPattern> 835 </mobile> 836 <tollFree> 837 <nationalNumberPattern>\d{8}</nationalNumberPattern> 838 </tollFree> 839 </territory> 840 841 <!-- Universal International Premium Rate Number --> 842 <territory id="001" countryCode="979"> 843 <availableFormats> 844 <numberFormat pattern="(\d)(\d{4})(\d{4})"> 845 <format>$1 $2 $3</format> 846 </numberFormat> 847 </availableFormats> 848 <generalDesc> 849 <nationalNumberPattern>\d{9}</nationalNumberPattern> 850 <possibleNumberPattern>\d{9}</possibleNumberPattern> 851 <exampleNumber>123456789</exampleNumber> 852 </generalDesc> 853 <fixedLine> 854 <nationalNumberPattern>NA</nationalNumberPattern> 855 <possibleNumberPattern>NA</possibleNumberPattern> 856 </fixedLine> 857 <mobile> 858 <nationalNumberPattern>NA</nationalNumberPattern> 859 <possibleNumberPattern>NA</possibleNumberPattern> 860 </mobile> 861 <premiumRate> 862 <nationalNumberPattern>\d{9}</nationalNumberPattern> 863 </premiumRate> 864 </territory> 865 </territories> 866 </phoneNumberMetadata> 867