Source

libphonenumber-csharp / resources / PhoneNumberMetaDataForTesting.xml

Full commit
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
<!-- Copyright (C) 2009 The Libphonenumber Authors

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.

     @author: Shaopeng Jia

     MetaData on Phone Number Plan and formatting rules. This file is used
     solely for the purpose of unittesting, so data in this file is not
     necessarily consistent with that of PhoneNumberMetaData.xml.
-->

<phoneNumberMetadata>
  <territories>
    <!-- Andorra -->
    <territory id="AD" countryCode="376" internationalPrefix="00">
    </territory>

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

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

    <!-- Australia -->
    <territory id="AU" countryCode="61" internationalPrefix="001[12]"
               nationalPrefix="0" preferredInternationalPrefix="0011"
               nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat nationalPrefixFormattingRule="$FG"
          pattern="(\d{4})(\d{3})(\d{3})" >
          <leadingDigits>1</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{1})(\d{4})(\d{4})">
          <leadingDigits>[2-478]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc >
        <nationalNumberPattern>[1-578]\d{4,14}</nationalNumberPattern>
        <possibleNumberPattern>\d{5,15}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[2378]\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>4\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>1800\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>190[0126]\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </premiumRate>
    </territory>

    <!-- Brazil -->
    <territory id="BR" countryCode="55" internationalPrefix="0014" nationalPrefix="0">
      <emergency>
        <nationalNumberPattern>
          19[023]|
          911
        </nationalNumberPattern>
        <possibleNumberPattern>\d{3}</possibleNumberPattern>
        <exampleNumber>190</exampleNumber>
      </emergency>
    </territory>

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

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

    <!-- United Kingdom -->
    <territory id="GB" countryCode="44" internationalPrefix="00"
               nationalPrefix="0" nationalPrefixFormattingRule="($NP$FG)">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>[1-59]|[78]0</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{3})(\d{3})">
          <leadingDigits>6</leadingDigits>
          <format>$1 $2 $3 $4</format>
        </numberFormat>
        <numberFormat pattern="(\d{4})(\d{3})(\d{3})">
          <leadingDigits>7[1-57-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>8[47]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>\d{10}</nationalNumberPattern>
        <possibleNumberPattern>\d{6,10}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[1-6]\d{9}</nationalNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>7[1-57-9]\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>9[018]\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </premiumRate>
      <sharedCost>
        <nationalNumberPattern>8(?:4[3-5]|7[0-2])\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </sharedCost>
      <voip>
        <nationalNumberPattern>56\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </voip>
      <personalNumber>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </personalNumber>
    </territory>

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

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

    <!-- Korea (Rep. of) -->
    <!-- http://www.itu.int/oth/T0202000072/en -->
    <!-- http://en.wikipedia.org/wiki/%2B82 -->
    <!-- http://www.kcc.go.kr/user.do?mode=view&page=P02030300&dc=K02030300&boardId=1074&boardSeq=2349 -->
    <!-- http://www.kcc.go.kr/user.do?mode=view&page=P02030300&dc=K02030300&boardId=1074&boardSeq=2240 -->
    <!-- http://www.telecentro.co.kr/sub/index.php?job=detail&ebcf_id=faq&page=1&mid=0503&eb_seq=36 -->
    <!-- Exceptions :
        internationalPrefix
            0031, 0033, 0071, 0073 - Special services of KT and DACOM, ignorable
        nationalPrefix
            1[4-6]XX-YYYY - Country-wide common number services, display as it is without hyphens -->
    <territory id="KR" countryCode="82" internationalPrefix="00(?:[124-68]|[37]\d{2})"
               nationalPrefix="0" nationalPrefixForParsing="0(8[1-46-8]|85\d{2})?"
               nationalPrefixFormattingRule="$NP$FG">
      <availableFormats>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>1(?:0|1[19]|[69]9|5[458])|[57]0</leadingDigits>
          <leadingDigits>1(?:0|1[19]|[69]9|5(?:44|59|8))|[57]0</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})(\d{4})">
          <leadingDigits>1(?:[169][2-8]|[78]|5[1-4])|[68]0|[3-6][1-9][2-9]</leadingDigits>
          <leadingDigits>1(?:[169][2-8]|[78]|5(?:[1-3]|4[56]))|[68]0|[3-6][1-9][2-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d)(\d{4})">
          <leadingDigits>131</leadingDigits>
          <leadingDigits>1312</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{2})(\d{4})">
          <leadingDigits>131</leadingDigits>
          <leadingDigits>131[13-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>13[2-9]</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{2})(\d{3})(\d{4})">
          <leadingDigits>30</leadingDigits>
          <format>$1-$2-$3-$4</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})(\d{4})">
          <leadingDigits>2(?:[26]|3[0-467])</leadingDigits>
          <leadingDigits>2(?:[26]|3(?:01|1[45]|2[17-9]|39|4|6[67]|7[078]))</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})(\d{4})">
          <leadingDigits>2(?:3[0-35-9]|[457-9])</leadingDigits>
          <leadingDigits>2(?:3(?:0[02-9]|1[0-36-9]|2[02-6]|3[0-8]|6[0-589]|7[1-69]|[589])|[457-9])</leadingDigits>
          <format>$1-$2-$3</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{3})">
          <leadingDigits>21[0-46-9]</leadingDigits>
          <leadingDigits>21(?:[0-247-9]|3[124]|6[1269])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d)(\d{4})">
          <leadingDigits>21[36]</leadingDigits>
          <leadingDigits>21(?:3[035-9]|6[03-578])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{3})">
          <leadingDigits>[3-6][1-9]1</leadingDigits>
          <leadingDigits>[3-6][1-9]1(?:[0-46-9])</leadingDigits>
          <leadingDigits>[3-6][1-9]1(?:[0-247-9]|3[124]|6[1269])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})">
          <leadingDigits>[3-6][1-9]1</leadingDigits>
          <leadingDigits>[3-6][1-9]1[36]</leadingDigits>
          <leadingDigits>[3-6][1-9]1(?:3[035-9]|6[03-578])</leadingDigits>
          <format>$1-$2</format>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-7]\d{3,9}|8\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{4,10}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>(?:2|[34][1-3]|5[1-5]|6[1-4])(?:1\d{2,3}|[2-9]\d{6,7})</nationalNumberPattern>
        <possibleNumberPattern>\d{4,10}</possibleNumberPattern>
        <exampleNumber>22123456</exampleNumber>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1[0-25-9]\d{7,8}</nationalNumberPattern>
        <possibleNumberPattern>\d{9,10}</possibleNumberPattern>
        <exampleNumber>1023456789</exampleNumber>
      </mobile>
      <tollFree>
        <nationalNumberPattern>80\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
        <exampleNumber>801234567</exampleNumber>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>60[2-9]\d{6}</nationalNumberPattern>
        <possibleNumberPattern>\d{9}</possibleNumberPattern>
        <exampleNumber>602345678</exampleNumber>
      </premiumRate>
      <personalNumber>
        <nationalNumberPattern>50\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
        <exampleNumber>5012345678</exampleNumber>
      </personalNumber>
      <voip>
        <nationalNumberPattern>70\d{8}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
        <exampleNumber>7012345678</exampleNumber>
      </voip>
    </territory>

    <!-- Mexico -->
    <territory id="MX" countryCode="52" internationalPrefix="00"
               nationalPrefix="01" nationalPrefixForParsing="01|04[45](\d{10})"
               nationalPrefixTransformRule="1$1" nationalPrefixFormattingRule="$NP $FG"
               nationalPrefixOptionalWhenFormatting="true">
      <availableFormats>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>[89]00</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{2})(\d{4})(\d{4})">
          <leadingDigits>33|55|81</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat pattern="(\d{3})(\d{3})(\d{4})">
          <leadingDigits>[2467]|3[0-24-9]|5[0-46-9]|8[2-9]|9[1-9]</leadingDigits>
          <format>$1 $2 $3</format>
        </numberFormat>
        <numberFormat nationalPrefixFormattingRule="$FG" pattern="(1)(\d{2})(\d{4})(\d{4})">
          <leadingDigits>1(?:33|55|81)</leadingDigits>
          <format>045 $2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
        <numberFormat nationalPrefixFormattingRule="$FG" pattern="(1)(\d{3})(\d{3})(\d{4})">
          <leadingDigits>1(?:[124579]|3[0-24-9]|5[0-46-9]|8[02-9])</leadingDigits>
          <format>045 $2 $3 $4</format>
          <intlFormat>$1 $2 $3 $4</intlFormat>
        </numberFormat>
      </availableFormats>
      <generalDesc>
        <nationalNumberPattern>[1-9]\d{9,10}</nationalNumberPattern>
        <possibleNumberPattern>\d{7,11}</possibleNumberPattern>
      </generalDesc>
      <fixedLine>
        <nationalNumberPattern>[2-9]\d{9}</nationalNumberPattern>
        <possibleNumberPattern>\d{7,10}</possibleNumberPattern>
      </fixedLine>
      <mobile>
        <nationalNumberPattern>1\d{10}</nationalNumberPattern>
        <possibleNumberPattern>\d{11}</possibleNumberPattern>
      </mobile>
      <tollFree>
        <nationalNumberPattern>800\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </tollFree>
      <premiumRate>
        <nationalNumberPattern>900\d{7}</nationalNumberPattern>
        <possibleNumberPattern>\d{10}</possibleNumberPattern>
      </premiumRate>
    </territory>

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

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

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

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

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

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

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

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