Skip to content

Commit e74c441

Browse files
Update the validation patterns (GH-52)
2 parents 943f303 + 3369d46 commit e74c441

File tree

3 files changed

+39
-34
lines changed

3 files changed

+39
-34
lines changed

resources/metadata.xml

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,8 @@
15591559
364|
15601560
4(?:
15611561
1[2-8]|
1562-
[235][4-6]|
1562+
[25][4-6]|
1563+
3[3-6]|
15631564
84
15641565
)|
15651566
5(?:
@@ -1641,6 +1642,7 @@
16411642
)|
16421643
7(?:
16431644
18|
1645+
35|
16441646
5[17]
16451647
)
16461648
)
@@ -1686,7 +1688,7 @@
16861688
7(?:
16871689
16|
16881690
2[15]|
1689-
3[145]|
1691+
3[14]|
16901692
4[13]|
16911693
5[468]|
16921694
7[2-5]|
@@ -1833,7 +1835,8 @@
18331835
364|
18341836
4(?:
18351837
1[2-8]|
1836-
[235][4-6]|
1838+
[25][4-6]|
1839+
3[3-6]|
18371840
84
18381841
)|
18391842
5(?:
@@ -1916,6 +1919,7 @@
19161919
)|
19171920
7(?:
19181921
18|
1922+
35|
19191923
5[17]
19201924
)
19211925
)
@@ -1961,7 +1965,7 @@
19611965
7(?:
19621966
16|
19631967
2[15]|
1964-
3[145]|
1968+
3[14]|
19651969
4[13]|
19661970
5[468]|
19671971
7[2-5]|
@@ -8754,7 +8758,7 @@
87548758
[2-5]\d|
87558759
60
87568760
)|
8757-
190|
8761+
19[01]|
87588762
[2379]\d\d
87598763
)
87608764
)\d{5}
@@ -10396,7 +10400,8 @@
1039610400
1[69]|
1039710401
3[2-49]|
1039810402
4[0-3]|
10399-
6[5-8]
10403+
6[5-8]|
10404+
7\d
1040010405
)|
1040110406
5(?:
1040210407
1[578]|
@@ -13151,7 +13156,7 @@
1315113156
</territory>
1315213157

1315313158
<!-- Hong Kong (HK) -->
13154-
<!-- http://www.ofca.gov.hk/en/industry_focus/telecommunications/portability/index.html -->
13159+
<!-- https://www.ofca.gov.hk/en/industry_focus/industry_focus/portability/numbering/index.html -->
1315513160
<territory id="HK" countryCode="852" preferredInternationalPrefix="00"
1315613161
internationalPrefix="00(?:30|5[09]|[126-9]?)" mobileNumberPortableRegion="true">
1315713162
<availableFormats>
@@ -13787,7 +13792,7 @@
1378713792
<format>$1 $2</format>
1378813793
</numberFormat>
1378913794
<!-- http://en.wikipedia.org/wiki/Toll-free_telephone_number, and examples on the web show
13790-
that sometimes they are followed by fewer digits. -->
13795+
that sometimes they are followed by fewer digits -->
1379113796
<numberFormat pattern="(\d{3})(\d{5,7})" nationalPrefixFormattingRule="$NP$FG">
1379213797
<leadingDigits>800</leadingDigits>
1379313798
<format>$1 $2</format>
@@ -13822,8 +13827,8 @@
1382213827
<leadingDigits>8</leadingDigits>
1382313828
<format>$1-$2-$3</format>
1382413829
</numberFormat>
13825-
<!-- 12 digit toll free numbers. -->
13826-
<numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{3})">
13830+
<!-- Format for 001803 toll free numbers. -->
13831+
<numberFormat pattern="(\d{3})(\d{3})(\d{3})(\d{2,8})">
1382713832
<leadingDigits>001</leadingDigits>
1382813833
<format>$1 $2 $3 $4</format>
1382913834
<intlFormat>NA</intlFormat>
@@ -13837,24 +13842,22 @@
1383713842
</availableFormats>
1383813843
<generalDesc>
1383913844
<nationalNumberPattern>
13845+
00[1-9]\d{9,14}|
1384013846
(?:
13841-
(?:
13842-
00[1-9]|
13843-
8\d
13844-
)\d{4}|
13845-
[1-36]
13847+
[1-36]|
13848+
8\d{5}
1384613849
)\d{6}|
13847-
00\d{10}|
13850+
00\d{9}|
1384813851
[1-9]\d{8,10}|
1384913852
[2-9]\d{7}
1385013853
</nationalNumberPattern>
1385113854
</generalDesc>
1385213855
<!-- 00798 ITFS numbers can't be dialled internationally. Source:
1385313856
https://support.twilio.com/hc/en-us/articles/115007579027-Toll-free-phone-number-restrictions-and-limitations -->
1385413857
<noInternationalDialling>
13855-
<possibleLengths national="10,12,13"/>
13858+
<possibleLengths national="[10-17]"/>
1385613859
<nationalNumberPattern>
13857-
001803\d{6,7}|
13860+
001803\d{5,11}|
1385813861
(?:
1385913862
007803\d|
1386013863
8071
@@ -13952,15 +13955,17 @@
1395213955
<nationalNumberPattern>8[1-35-9]\d{7,10}</nationalNumberPattern>
1395313956
</mobile>
1395413957
<tollFree>
13955-
<possibleLengths national="[8-13]"/>
13958+
<possibleLengths national="[8-17]"/>
1395613959
<exampleNumber>8001234567</exampleNumber>
1395713960
<nationalNumberPattern>
13958-
00[17]803\d{7}|
13961+
00(?:
13962+
1803\d{5,11}|
13963+
7803\d{7}
13964+
)|
1395913965
(?:
1396013966
177\d|
1396113967
800
13962-
)\d{5,7}|
13963-
001803\d{6}
13968+
)\d{5,7}
1396413969
</nationalNumberPattern>
1396513970
</tollFree>
1396613971
<!-- The information below is provided by an Indonesian -->
@@ -14273,9 +14278,9 @@
1427314278
)\d{4}|
1427414279
5(?:
1427514280
(?:
14276-
[02][02-9]|
14277-
[149][2-9]|
14281+
[0-2][02-9]|
1427814282
[36]\d|
14283+
[49][2-9]|
1427914284
8[3-7]
1428014285
)\d|
1428114286
5(?:
@@ -22074,9 +22079,9 @@
2207422079
)|
2207522080
4(?:
2207622081
1[1-57-9]|
22077-
[25-7][1-9]|
22082+
[267][1-9]|
2207822083
3[1-8]|
22079-
4\d|
22084+
[45]\d|
2208022085
8[1-35-9]|
2208122086
9[2-689]
2208222087
)|
@@ -22147,9 +22152,9 @@
2214722152
)|
2214822153
4(?:
2214922154
1[1-57-9]|
22150-
[25-7][1-9]|
22155+
[267][1-9]|
2215122156
3[1-8]|
22152-
4\d|
22157+
[45]\d|
2215322158
8[1-35-9]|
2215422159
9[2-689]
2215522160
)|
@@ -23564,7 +23569,7 @@
2356423569
<possibleLengths national="8" localOnly="7"/>
2356523570
<exampleNumber>32345678</exampleNumber>
2356623571
<nationalNumberPattern>
23567-
24099\d{3}|
23572+
240\d{5}|
2356823573
(?:
2356923574
3[2-79]|
2357023575
[49][2-9]|
@@ -26628,7 +26633,7 @@
2662826633
</territory>
2662926634

2663026635
<!-- Singapore (SG) -->
26631-
<!-- http://www.ida.gov.sg/Policies-and-Regulations/Industry-and-Licensees/Numbering/National-Numbering-Plan-and-Allocation-Process.aspx -->
26636+
<!-- https://www.imda.gov.sg/regulations-and-licensing-listing/numbering/national-numbering-plan-and-allocation-process -->
2663226637
<!-- https://en.wikipedia.org/wiki/Telephone_numbers_in_Singapore -->
2663326638
<territory id="SG" countryCode="65" internationalPrefix="0[0-3]\d"
2663426639
mobileNumberPortableRegion="true">
@@ -31489,7 +31494,7 @@
3148931494
<!-- South Africa (ZA) -->
3149031495
<!-- http://www.itu.int/oth/T02020000C1/en -->
3149131496
<!-- http://en.wikipedia.org/wiki/Telephone_numbers_in_South_Africa -->
31492-
<!-- https://www.icasa.org.za/Portals/0/Regulations/Regulations/NumberingPlanReg.pdf -->
31497+
<!-- https://www.icasa.org.za/legislation-and-regulations/amendment-of-the-numbering-plan-regulations-2016 -->
3149331498
<territory id="ZA" countryCode="27" internationalPrefix="00" nationalPrefix="0"
3149431499
mobileNumberPortableRegion="true">
3149531500
<availableFormats>

src/metadata/countries.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@
10411041
"id",
10421042
"Indonesia",
10431043
"62",
1044-
"+62 (..) ... ... ....."
1044+
"+62 (..) ... ... ... ... ..."
10451045
],
10461046
[
10471047
"ir",

src/metadata/validations.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@
360360
"^[235-7]\\d{8}|[1-9]\\d{7}$"
361361
],
362362
"id": [
363-
"^\\d{7,13}$",
364-
"^(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}$"
363+
"^\\d{7,17}$",
364+
"^00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}$"
365365
],
366366
"ie": [
367367
"^\\d{7,10}$",

0 commit comments

Comments
 (0)