Skip to content

Commit

Permalink
Update the validation patterns (GH-24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtyomVancyan authored Apr 9, 2024
2 parents 196acb0 + 83cd1a0 commit 4ce3f52
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 37 deletions.
106 changes: 71 additions & 35 deletions resources/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7596,13 +7596,12 @@
</availableFormats>
<generalDesc>
<nationalNumberPattern>
[27]\d{6,7}|
[34]\d{5,7}|
63\d{6}|
(?:
5|
[2-7]|
8\d\d
)\d{7}
)\d{7}|
[2-47]\d{6}|
[34]\d{5}
</nationalNumberPattern>
</generalDesc>
<!-- Based on one of the data sources, 80[25] and 878 ranges are fixed-line as per
Expand Down Expand Up @@ -7636,7 +7635,7 @@
<nationalNumberPattern>
(?:
5\d|
63
6[2-4]
)\d{6}
</nationalNumberPattern>
</mobile>
Expand Down Expand Up @@ -8680,15 +8679,56 @@
<exampleNumber>32123456</exampleNumber>
<nationalNumberPattern>
(?:
[2-7]\d|
8[126-9]|
9[1-46-9]
)\d{6}
(?:
2\d|
9[1-46-9]
)\d|
3(?:
[0-37]\d|
4[013]|
5[0-58]|
6[01347-9]|
8[0-8]|
9[0-79]
)|
4(?:
[0-25]\d|
[34][02-9]|
6[013-579]|
7[013579]|
8[0-47]|
9[0-27]
)|
5(?:
[0-36]\d|
4[0146-9]|
5[03-57-9]|
7[0568]|
8[0-358]|
9[0-69]
)|
6(?:
[013578]\d|
2[0-68]|
4[02-8]|
6[01689]|
9[015689]
)|
7(?:
[0-69]\d|
7[03-9]|
8[0147]
)|
8(?:
[16-9]\d|
2[0-58]
)
)\d{5}
</nationalNumberPattern>
</fixedLine>
<mobile>
<possibleLengths national="8"/>
<exampleNumber>32123456</exampleNumber>
<exampleNumber>34412345</exampleNumber>
<nationalNumberPattern>
(?:
[2-7]\d|
Expand Down Expand Up @@ -10935,8 +10975,8 @@
4(?:
[06]8|
3[5-9]|
4[0-49]|
5[5-79]|
4[0-4]|
5[579]|
73|
90
)|
Expand All @@ -10959,7 +10999,8 @@
0[2-79]|
1[04-9]|
2[0-5]|
58
49|
5[68]
)|
5(?:
2[01]|
Expand Down Expand Up @@ -12381,7 +12422,7 @@
7(?:
[01]\d|
2[156]|
31|
3[12]|
49
)
)\d{4}
Expand Down Expand Up @@ -13595,7 +13636,7 @@
7(?:
38(?:
0\d|
5[019]|
5[0-29]|
88
)|
8(?:
Expand Down Expand Up @@ -16851,7 +16892,7 @@
<nationalNumberPattern>
(?:
1(?:
0[0-6]|
0[0-8]|
1[0-5]|
2[014]|
30
Expand Down Expand Up @@ -18213,14 +18254,11 @@
<possibleLengths national="10"/>
<exampleNumber>2023123456</exampleNumber>
<nationalNumberPattern>
2088\d{6}|
(?:
20(?:
[2359]\d|
7[6-8]|
88
)|
302\d
)\d{6}
20[23579]|
302
)\d{7}
</nationalNumberPattern>
</mobile>
<!-- The Lonely Planet says that newer WIN phones (fixed phones without a physical landline)
Expand Down Expand Up @@ -21335,7 +21373,7 @@
44|
7[27]|
87|
99
9[69]
)[1-9]|
65[0-689]
)\d{7}|
Expand All @@ -21348,7 +21386,7 @@
6[0-46-9]|
7[013-689]|
8[1-69]|
9[1-8]
9[1-578]
)|
[2-9]\d
)\d{8}
Expand Down Expand Up @@ -21421,10 +21459,9 @@
2[1-4]|
3[2-46-8]|
5[1348]|
6[1-9]|
[69]\d|
7[12]|
8[1-8]|
9\d
8[1-8]
)
)\d{7}
</nationalNumberPattern>
Expand Down Expand Up @@ -21557,10 +21594,9 @@
2[1-4]|
3[2-46-8]|
5[1348]|
6[1-9]|
[69]\d|
7[12]|
8[1-8]|
9\d
8[1-8]
)
)\d{7}
</nationalNumberPattern>
Expand Down Expand Up @@ -29001,7 +29037,7 @@
[0-35-9]\d|
4[468]
)|
7302[0-3]\d
7302[0-4]\d
)\d{4}|
(?:
472[24]|
Expand Down Expand Up @@ -29107,7 +29143,7 @@
[0-35-9]\d|
4[468]
)|
7302[0-3]\d
7302[0-4]\d
)\d{4}|
(?:
472[24]|
Expand Down Expand Up @@ -31437,7 +31473,7 @@
<exampleNumber>712345678</exampleNumber>
<nationalNumberPattern>
7(?:
[178]\d|
[1278]\d|
3[1-9]
)\d{6}
</nationalNumberPattern>
Expand Down
4 changes: 2 additions & 2 deletions src/metadata/validations.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
],
"cu": [
"^\\d{6,10}$",
"^[27]\\d{6,7}|[34]\\d{5,7}|63\\d{6}|(?:5|8\\d\\d)\\d{7}$"
"^(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}$"
],
"cv": [
"^\\d{7}$",
Expand Down Expand Up @@ -577,7 +577,7 @@
],
"mx": [
"^\\d{10,11}$",
"^1(?:(?:22|44|7[27]|87|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-689]|8[1-69]|9[1-8])|[2-9]\\d)\\d{8}$"
"^1(?:(?:22|44|7[27]|87|9[69])[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-689]|8[1-69]|9[1-578])|[2-9]\\d)\\d{8}$"
],
"my": [
"^\\d{8,10}$",
Expand Down

0 comments on commit 4ce3f52

Please sign in to comment.