Skip to content

Commit 52413ac

Browse files
Update the validation patterns (GH-28)
2 parents 62d2ec4 + 4c24c1a commit 52413ac

File tree

2 files changed

+49
-42
lines changed

2 files changed

+49
-42
lines changed

resources/metadata.xml

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,6 @@
14351435
<possibleLengths national="10" localOnly="[6-8]"/>
14361436
<exampleNumber>1123456789</exampleNumber>
14371437
<nationalNumberPattern>
1438-
3888[013-9]\d{5}|
14391438
3(?:
14401439
7(?:
14411440
1[15]|
@@ -1576,7 +1575,8 @@
15761575
0[45]|
15771576
[17][2-6]|
15781577
3[4-6]|
1579-
[58][3-6]
1578+
5[3-6]|
1579+
8[3-68]
15801580
)
15811581
)
15821582
)\d{6}|
@@ -1714,17 +1714,14 @@
17141714
7(?:
17151715
1[15]|
17161716
81
1717-
)[46]|
1717+
)|
17181718
8(?:
1719-
(?:
1720-
21|
1721-
4[16]|
1722-
69|
1723-
9[12]
1724-
)[46]|
1725-
88[013-9]
1719+
21|
1720+
4[16]|
1721+
69|
1722+
9[12]
17261723
)
1727-
)\d{5}|
1724+
)[46]\d{5}|
17281725
9(?:
17291726
2(?:
17301727
657|
@@ -1852,7 +1849,8 @@
18521849
0[45]|
18531850
[17][2-6]|
18541851
3[4-6]|
1855-
[58][3-6]
1852+
5[3-6]|
1853+
8[3-68]
18561854
)
18571855
)
18581856
)
@@ -5014,7 +5012,7 @@
50145012
6(?:
50155013
2[1-35]|
50165014
5[149]|
5017-
8[067]
5015+
8[013467]
50185016
)
50195017
)\d{4}
50205018
</nationalNumberPattern>
@@ -5053,8 +5051,8 @@
50535051
<nationalNumberPattern>
50545052
79(?:
50555053
1(?:
5056-
[01]\d|
5057-
2[0-8]
5054+
[0-2]\d|
5055+
3[0-3]
50585056
)|
50595057
2[0-7]\d
50605058
)\d{3}
@@ -5865,7 +5863,12 @@
58655863
<mobile>
58665864
<possibleLengths national="9"/>
58675865
<exampleNumber>781234567</exampleNumber>
5868-
<nationalNumberPattern>7[35-9]\d{7}</nationalNumberPattern>
5866+
<nationalNumberPattern>
5867+
(?:
5868+
6[89]|
5869+
7[235-9]
5870+
)\d{7}
5871+
</nationalNumberPattern>
58695872
</mobile>
58705873
<!-- https://www.eofcom.admin.ch/eofcom/public/listEofcom_e164Allocated.do -->
58715874
<pager>
@@ -10345,12 +10348,12 @@
1034510348
as this breaks parsing (it treats all leading zeros as national prefixes. -->
1034610349
<!-- http://www.itu.int/oth/T020200004E/en -->
1034710350
<!-- http://www.arcep.ga -->
10348-
<territory id="GA" countryCode="241" internationalPrefix="00"
10351+
<territory id="GA" countryCode="241" internationalPrefix="00" nationalPrefix="0"
1034910352
nationalPrefixForParsing="0(11\d{6}|60\d{6}|61\d{6}|6[256]\d{6}|7[467]\d{6})"
1035010353
nationalPrefixTransformRule="$1">
1035110354
<availableFormats>
1035210355
<!-- If no leading zero was supplied, format with the national prefix. -->
10353-
<numberFormat pattern="(\d)(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="0$FG">
10356+
<numberFormat pattern="(\d)(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
1035410357
<leadingDigits>[2-7]</leadingDigits>
1035510358
<format>$1 $2 $3 $4</format>
1035610359
</numberFormat>
@@ -10360,11 +10363,8 @@
1036010363
<format>$1 $2 $3 $4</format>
1036110364
</numberFormat>
1036210365
<!-- Even in new way of dialling, 0 is mandatory when dialling domestically. -->
10363-
<numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="0$FG">
10364-
<leadingDigits>
10365-
11|
10366-
[67]
10367-
</leadingDigits>
10366+
<numberFormat pattern="(\d{2})(\d{2})(\d{2})(\d{2})" nationalPrefixFormattingRule="$NP$FG">
10367+
<leadingDigits>[167]</leadingDigits>
1036810368
<format>$1 $2 $3 $4</format>
1036910369
</numberFormat>
1037010370
</availableFormats>
@@ -11166,14 +11166,15 @@
1116611166
0\d|
1116711167
11|
1116811168
22|
11169-
33|
11169+
3[0-6]|
1117011170
44|
1117111171
5[05]|
1117211172
77|
1117311173
88|
1117411174
9[09]
1117511175
)|
11176-
111
11176+
111|
11177+
77\d
1117711178
)|
1117811179
1(?:
1117911180
1(?:
@@ -11182,14 +11183,16 @@
1118211183
)|
1118311184
4\d\d
1118411185
)|
11185-
(?:
11186-
44|
11187-
6[89]
11188-
)\d\d|
11186+
[23]555|
11187+
4(?:
11188+
4\d\d|
11189+
555
11190+
)|
1118911191
5(?:
1119011192
[0157-9]\d\d|
1119111193
200
1119211194
)|
11195+
6[89]\d\d|
1119311196
7(?:
1119411197
[0147-9]\d\d|
1119511198
5(?:
@@ -11202,7 +11205,10 @@
1120211205
[018]\d|
1120311206
2[0-4]
1120411207
)|
11205-
58[89]|
11208+
5(?:
11209+
55|
11210+
8[89]
11211+
)|
1120611212
8(?:
1120711213
55|
1120811214
88
@@ -12420,8 +12426,8 @@
1242012426
6\d\d|
1242112427
7(?:
1242212428
[01]\d|
12423-
2[1256]|
12424-
3[12]|
12429+
2[0-256]|
12430+
3[0-2]|
1242512431
49
1242612432
)
1242712433
)\d{4}
@@ -21112,7 +21118,8 @@
2111221118
)|
2111321119
4(?:
2111421120
[013568]\d|
21115-
2[4-8]
21121+
2[4-8]|
21122+
71
2111621123
)|
2111721124
54(?:
2111821125
[3-5]\d|
@@ -25613,6 +25620,7 @@
2561325620
<availableFormats>
2561425621
<numberFormat pattern="(\d{2})(\d{5})">
2561525622
<leadingDigits>
25623+
6[89]|
2561625624
7|
2561725625
8[4-9]|
2561825626
9(?:
@@ -25625,10 +25633,8 @@
2562525633
</availableFormats>
2562625634
<generalDesc>
2562725635
<nationalNumberPattern>
25628-
(?:
25629-
[1-6]|
25630-
[7-9]\d\d
25631-
)\d{4}
25636+
[6-9]\d{6}|
25637+
[1-6]\d{4}
2563225638
</nationalNumberPattern>
2563325639
</generalDesc>
2563425640
<!-- Although not mentioned in the 2011 update, it seems likely that the range 67300-67699
@@ -25653,6 +25659,7 @@
2565325659
48\d{3}|
2565425660
(?:
2565525661
(?:
25662+
6[89]|
2565625663
7[1-9]|
2565725664
8[4-9]
2565825665
)\d|
@@ -26150,7 +26157,7 @@
2615026157
<exampleNumber>81234567</exampleNumber>
2615126158
<nationalNumberPattern>
2615226159
8(?:
26153-
09[0-24]|
26160+
09[0-6]|
2615426161
95[0-2]
2615526162
)\d{4}|
2615626163
(?:
@@ -27709,7 +27716,7 @@
2770927716
2[02]|
2771027717
[34]0|
2771127718
5[05]|
27712-
7[0178]|
27719+
7[01578]|
2771327720
8[078]|
2771427721
9\d
2771527722
)\d{7}
@@ -30226,7 +30233,7 @@
3022630233
<nationalNumberPattern>
3022730234
340(?:
3022830235
2(?:
30229-
0[0-368]|
30236+
0\d|
3023030237
2[06-8]|
3023130238
4[49]|
3023230239
77
@@ -30267,7 +30274,7 @@
3026730274
<nationalNumberPattern>
3026830275
340(?:
3026930276
2(?:
30270-
0[0-368]|
30277+
0\d|
3027130278
2[06-8]|
3027230279
4[49]|
3027330280
77

src/metadata/validations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@
721721
],
722722
"sb": [
723723
"^\\d{5,7}$",
724-
"^(?:[1-6]|[7-9]\\d\\d)\\d{4}$"
724+
"^[6-9]\\d{6}|[1-6]\\d{4}$"
725725
],
726726
"sc": [
727727
"^\\d{7}$",

0 commit comments

Comments
 (0)