Skip to content

Commit

Permalink
Update the validation patterns (GH-58)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomVancyan authored Nov 12, 2023
2 parents 7c435dd + 4927abc commit 37c6944
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 39 deletions.
97 changes: 60 additions & 37 deletions resources/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3923,6 +3923,7 @@
0\d|
3[12]|
44|
55|
7[7-9]|
88
)|
Expand Down Expand Up @@ -4073,7 +4074,7 @@
<exampleNumber>90011234</exampleNumber>
<nationalNumberPattern>
(?:
4[0-356]|
4[0-6]|
[56]\d|
9[013-9]
)\d{6}
Expand Down Expand Up @@ -9347,9 +9348,9 @@
8[0-247-9]
)|
7(?:
[017]\d|
[0167]\d|
2[0-2]|
6[0-8]|
5[01]|
8[0-3]
)
)\d{6}
Expand Down Expand Up @@ -11990,7 +11991,7 @@
<!-- Calling code and formatting shared with 'US' -->
<!-- http://www.nationalnanpa.com/nas/public/assigned_code_query_step1.do?method=resetCodeQueryModel -->
<territory id="GU" countryCode="1" leadingDigits="671" internationalPrefix="011"
nationalPrefix="1" nationalPrefixForParsing="([3-9]\d{6})$|1"
nationalPrefix="1" nationalPrefixForParsing="([2-9]\d{6})$|1"
nationalPrefixTransformRule="671$1">
<generalDesc>
<nationalNumberPattern>
Expand All @@ -12008,6 +12009,7 @@
<exampleNumber>6713001234</exampleNumber>
<nationalNumberPattern>
671(?:
2\d\d|
3(?:
00|
3[39]|
Expand Down Expand Up @@ -12059,6 +12061,7 @@
<exampleNumber>6713001234</exampleNumber>
<nationalNumberPattern>
671(?:
2\d\d|
3(?:
00|
3[39]|
Expand Down Expand Up @@ -12222,12 +12225,10 @@
</availableFormats>
<generalDesc>
<nationalNumberPattern>
9008\d{3}|
(?:
[2-467]\d\d|
510|
862
)\d{4}
[2-8]\d{3}|
9008
)\d{3}
</nationalNumberPattern>
</generalDesc>
<fixedLine>
Expand All @@ -12241,7 +12242,7 @@
3[1-4]|
5[3-9]|
6\d|
7[0-24-79]
7[0-79]
)|
3(?:
2[25-9]|
Expand All @@ -12251,6 +12252,7 @@
4[0-24]|
5[56]
)|
50[0-6]|
77[1-57]
)\d{4}
</nationalNumberPattern>
Expand Down Expand Up @@ -12280,7 +12282,12 @@
<nationalNumberPattern>
(?:
289|
862
8(?:
00|
6[28]|
88|
99
)
)\d{4}
</nationalNumberPattern>
</tollFree>
Expand All @@ -12289,6 +12296,11 @@
<exampleNumber>9008123</exampleNumber>
<nationalNumberPattern>9008\d{3}</nationalNumberPattern>
</premiumRate>
<voip>
<possibleLengths national="7"/>
<exampleNumber>5151234</exampleNumber>
<nationalNumberPattern>515\d{4}</nationalNumberPattern>
</voip>
</territory>

<!-- Hong Kong (HK) -->
Expand Down Expand Up @@ -12370,7 +12382,6 @@
4(?:
44[5-9]|
6(?:
0[0-7]|
1[0-6]|
4[0-57-9]|
6[0-4]
Expand All @@ -12388,13 +12399,14 @@
848[0-25-9]|
9(?:
29[013-9]|
59[0-4]
59[0-4]|
899
)
)\d{4}|
(?:
4(?:
4[01]|
6[23578]
4[015]|
6[023578]
)|
5(?:
[1-59][0-46-9]|
Expand Down Expand Up @@ -19168,9 +19180,9 @@
8[0-247-9]
)|
7(?:
[017]\d|
[0167]\d|
2[0-2]|
6[0-8]|
5[01]|
8[0-3]
)
)\d{6}
Expand Down Expand Up @@ -22714,7 +22726,7 @@
<generalDesc>
<nationalNumberPattern>
(?:
[47]|
[4-7]|
888\d
)\d{3}
</nationalNumberPattern>
Expand All @@ -22725,9 +22737,14 @@
<nationalNumberPattern>[47]\d{3}</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="7"/>
<possibleLengths national="4,7"/>
<exampleNumber>8884012</exampleNumber>
<nationalNumberPattern>888[1-9]\d{3}</nationalNumberPattern>
<nationalNumberPattern>
(?:
[56]|
888[1-9]
)\d{3}
</nationalNumberPattern>
</mobile>
</territory>

Expand Down Expand Up @@ -25949,7 +25966,7 @@
<exampleNumber>81234567</exampleNumber>
<nationalNumberPattern>
8(?:
08[01]|
08[013]|
95[0-2]
)\d{4}|
(?:
Expand Down Expand Up @@ -28816,20 +28833,23 @@
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2015550123</exampleNumber>
<nationalNumberPattern>
5056(?:
[0-35-9]\d|
4[468]
(?:
5056(?:
[0-35-9]\d|
4[468]
)|
73020\d
)\d{4}|
(?:
4722|
505[2-57-9]|
983[29]
983[289]
)\d{6}|
(?:
2(?:
0[1-35-9]|
1[02-9]|
2[03-589]|
2[03-57-9]|
3[149]|
4[08]|
5[1-46]|
Expand All @@ -28840,11 +28860,11 @@
3(?:
0[1-57-9]|
1[02-9]|
2[01356]|
2[013569]|
3[0-24679]|
4[167]|
5[0-2]|
6[014]|
6[0149]|
8[056]
)|
4(?:
Expand Down Expand Up @@ -28917,20 +28937,23 @@
<possibleLengths national="10" localOnly="7"/>
<exampleNumber>2015550123</exampleNumber>
<nationalNumberPattern>
5056(?:
[0-35-9]\d|
4[468]
(?:
5056(?:
[0-35-9]\d|
4[468]
)|
73020\d
)\d{4}|
(?:
4722|
505[2-57-9]|
983[29]
983[289]
)\d{6}|
(?:
2(?:
0[1-35-9]|
1[02-9]|
2[03-589]|
2[03-57-9]|
3[149]|
4[08]|
5[1-46]|
Expand All @@ -28941,11 +28964,11 @@
3(?:
0[1-57-9]|
1[02-9]|
2[01356]|
2[013569]|
3[0-24679]|
4[167]|
5[0-2]|
6[014]|
6[0149]|
8[056]
)|
4(?:
Expand Down Expand Up @@ -30241,7 +30264,7 @@
)\d{6}|
(?:
3\d|
5[689]|
5[1689]|
7[06-9]|
8[1-8]|
9[0-8]
Expand Down Expand Up @@ -31622,7 +31645,7 @@
[24-9]0\d{4,7}
)|
(?:
1[013-79]|
1[0-79]|
2[24-689]|
3[02-689]|
4[0-4]
Expand Down
4 changes: 2 additions & 2 deletions src/metadata/validations.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
],
"gy": [
"^\\d{7}$",
"^9008\\d{3}|(?:[2-467]\\d\\d|510|862)\\d{4}$"
"^(?:[2-8]\\d{3}|9008)\\d{3}$"
],
"hk": [
"^\\d{5,11}$",
Expand Down Expand Up @@ -629,7 +629,7 @@
],
"nu": [
"^\\d{4,7}$",
"^(?:[47]|888\\d)\\d{3}$"
"^(?:[4-7]|888\\d)\\d{3}$"
],
"nz": [
"^\\d{5,10}$",
Expand Down

0 comments on commit 37c6944

Please sign in to comment.