From 68020772c39ec74ec144d5b44b2f5f5941533447 Mon Sep 17 00:00:00 2001 From: ArtyomVancyan Date: Sun, 17 Nov 2024 00:40:24 +0000 Subject: [PATCH] Update the validation patterns --- resources/metadata.xml | 500 ++++++++++++++++++---------------- src/metadata/countries.json | 2 +- src/metadata/validations.json | 10 +- 3 files changed, 277 insertions(+), 235 deletions(-) diff --git a/resources/metadata.xml b/resources/metadata.xml index aad9de3..c9744a9 100644 --- a/resources/metadata.xml +++ b/resources/metadata.xml @@ -1447,6 +1447,55 @@ 9[12] ) )[46]\d{5}| + (?: + (?: + 11[1-8]| + 670 + )\d| + 2(?: + 21[2-6]| + (?: + 3[06]| + 49 + )4| + 6(?: + 04| + 1[2-8] + )| + 9[17][4-6] + )| + 3(?: + (?: + 36| + 64 + )4| + 4(?: + 1[2-8]| + [25][4-6]| + 84 + )| + 5(?: + 1[2-9]| + [38][4-6] + )| + 8(?: + [17][2-6]| + 3[4-6]| + 8[3-68] + ) + ) + )\d{6}| + (?: + 2(?: + 23| + 64| + 99 + )| + 3(?: + 43| + 85 + ) + )[3-6]\d{6}| (?: 2(?: 657| @@ -1456,6 +1505,7 @@ ) )| 3(?: + 487| 7(?: 55| 77 @@ -1463,6 +1513,19 @@ 865 ) )[2-8]\d{5}| + (?: + 2(?: + [28]0| + 37| + 6[36]| + 9[48] + )| + 3(?: + 62| + 7[069]| + 80 + ) + )[45]\d{6}| (?: 2(?: 2(?: @@ -1474,7 +1537,7 @@ 26| 44 )| - 473| + 47[35]| 9(?: [07]2| 2[26]| @@ -1486,31 +1549,12 @@ )[45]\d{5}| (?: 2(?: - 284| - 3(?: - 02| - 23 - )| - 920 - )| - 3(?: - 4(?: - 46| - 8[27]| - 92 + 2(?: + 62| + 81 )| - 541| - 878 - ) - )[2-7]\d{5}| - (?: - 2(?: - (?: - 26| - 62 - )2| 320| - 477| + 622| 9(?: 42| 83 @@ -1527,60 +1571,24 @@ ) )[2-6]\d{5}| (?: - (?: - 11[1-8]| - 670 - )\d| 2(?: - 2(?: - 0[45]| - 1[2-6]| - 3[3-6] - )| + 284| 3(?: - [06]4| - 7[45] - )| - 494| - 6(?: - 04| - 1[2-8]| - [36][45]| - 4[3-6] + 02| + 23 )| - 80[45]| - 9(?: - [17][4-6]| - [48][45]| - 9[3-6] - ) + 477| + 920 )| 3(?: - 364| 4(?: - 1[2-8]| - [25][4-6]| - 3[3-6]| - 84 - )| - 5(?: - 1[2-9]| - [38][4-6] - )| - 6(?: - 2[45]| - 44 + 46| + [89]2 )| - 7[069][45]| - 8(?: - 0[45]| - [17][2-6]| - 3[4-6]| - 5[3-6]| - 8[3-68] - ) + 541| + 878 ) - )\d{6}| + )[2-7]\d{5}| 2(?: 2(?: 21| @@ -1597,7 +1605,6 @@ 5[346-8]| 9[3-5] )| - 475| 6(?: 2[46]| 4[78]| @@ -1614,10 +1621,7 @@ )4\d{5}| (?: 2(?: - 2(?: - 57| - 81 - )| + 257| 3(?: 24| 46| @@ -1724,6 +1728,55 @@ 9[12] ) )[46]\d{5}| + (?: + 675\d| + 9(?: + 11[1-8]\d| + 2(?: + 21[2-6]| + (?: + 3[06]| + 49 + )4| + 6(?: + 04| + 1[2-8] + )| + 9[17][4-6] + )| + 3(?: + (?: + 36| + 64 + )4| + 4(?: + 1[2-8]| + [25][4-6]| + 84 + )| + 5(?: + 1[2-9]| + [38][4-6] + )| + 8(?: + [17][2-6]| + 3[4-6]| + 8[3-68] + ) + ) + ) + )\d{6}| + 9(?: + 2(?: + 23| + 64| + 99 + )| + 3(?: + 43| + 85 + ) + )[3-6]\d{6}| 9(?: 2(?: 657| @@ -1733,6 +1786,7 @@ ) )| 3(?: + 487| 7(?: 55| 77 @@ -1740,6 +1794,19 @@ 865 ) )[2-8]\d{5}| + 9(?: + 2(?: + [28]0| + 37| + 6[36]| + 9[48] + )| + 3(?: + 62| + 7[069]| + 80 + ) + )[45]\d{6}| 9(?: 2(?: 2(?: @@ -1751,7 +1818,7 @@ 26| 44 )| - 473| + 47[35]| 9(?: [07]2| 2[26]| @@ -1763,31 +1830,12 @@ )[45]\d{5}| 9(?: 2(?: - 284| - 3(?: - 02| - 23 - )| - 920 - )| - 3(?: - 4(?: - 46| - 8[27]| - 92 + 2(?: + 62| + 81 )| - 541| - 878 - ) - )[2-7]\d{5}| - 9(?: - 2(?: - (?: - 26| - 62 - )2| 320| - 477| + 622| 9(?: 42| 83 @@ -1803,61 +1851,25 @@ 564 ) )[2-6]\d{5}| - (?: - 675\d| - 9(?: - 11[1-8]\d| - 2(?: - 2(?: - 0[45]| - 1[2-6]| - 3[3-6] - )| - 3(?: - [06]4| - 7[45] - )| - 494| - 6(?: - 04| - 1[2-8]| - [36][45]| - 4[3-6] - )| - 80[45]| - 9(?: - [17][4-6]| - [48][45]| - 9[3-6] - ) - )| + 9(?: + 2(?: + 284| 3(?: - 364| - 4(?: - 1[2-8]| - [25][4-6]| - 3[3-6]| - 84 - )| - 5(?: - 1[2-9]| - [38][4-6] - )| - 6(?: - 2[45]| - 44 - )| - 7[069][45]| - 8(?: - 0[45]| - [17][2-6]| - 3[4-6]| - 5[3-6]| - 8[3-68] - ) - ) + 02| + 23 + )| + 477| + 920 + )| + 3(?: + 4(?: + 46| + [89]2 + )| + 541| + 878 ) - )\d{6}| + )[2-7]\d{5}| 92(?: 2(?: 21| @@ -1874,7 +1886,6 @@ 5[346-8]| 9[3-5] )| - 475| 6(?: 2[46]| 4[78]| @@ -1891,10 +1902,7 @@ )4\d{5}| 9(?: 2(?: - 2(?: - 57| - 81 - )| + 257| 3(?: 24| 46| @@ -4053,29 +4061,41 @@ - + [24-689] $1 $2 $3 $4 + + 0 + $1 $2 $3 $4 $5 + - [24-689]\d{7} + + (?: + 01\d| + [24-689] + )\d{7} + - - 20211234 + + 0120211234 2090\d{4}| - 2(?: - 02| - 1[037]| - 2[45]| - 3[68]| - 4\d + (?: + 012\d\d| + 2(?: + 02| + 1[037]| + 2[45]| + 3[68]| + 4\d + ) )\d{5} @@ -4084,10 +4104,14 @@ other 9x and the complete 6x range as reserved. The prefixes 96 have also been added, along with 6[1267] (seemingly prefixes for Mobile MTN). --> - - 90011234 + + 0195123456 (?: + 01(?: + 2[5-9]| + [4-69]\d + )| 4[0-8]| [56]\d| 9[013-9] @@ -4121,7 +4145,10 @@ mobileNumberPortableRegion="true"> - 590\d{6}| + (?: + 590\d| + 7090 + )\d{5}| (?: 69| 80| @@ -4151,22 +4178,25 @@ 690001234 - 69(?: - 0\d\d| - 1(?: - 2[2-9]| - 3[0-5] - )| - 4(?: - 0[89]| - 1[2-6]| - 9\d + (?: + 69(?: + 0\d\d| + 1(?: + 2[2-9]| + 3[0-5] + )| + 4(?: + 0[89]| + 1[2-6]| + 9\d + )| + 6(?: + 1[016-9]| + 5[0-4]| + [67]\d + ) )| - 6(?: - 1[016-9]| - 5[0-4]| - [67]\d - ) + 7090[0-4] )\d{4} @@ -10593,7 +10623,7 @@ (?: - 1[49]| + 19| [2568] )[1-8]| 3(?: @@ -10654,9 +10684,9 @@ 131234567 - 1[35-7][1-8]\d{3,6}| + 1[3-7][1-8]\d{3,6}| (?: - 1[49][1-8]| + 19[1-8]| [23568][1-8]\d| 9(?: 00| @@ -11931,7 +11961,9 @@ )| 5(?: [0157-9]\d\d| - 200 + 200| + 333| + 444 )| 6[89]\d\d| 7(?: @@ -12506,7 +12538,7 @@ nationalPrefix="0" mobileNumberPortableRegion="true"> - [569] + [5-79] $1 $2 $3 $4 @@ -12516,7 +12548,10 @@ - 590\d{6}| + (?: + 590\d| + 7090 + )\d{5}| (?: 69| 80| @@ -12549,22 +12584,25 @@ 690001234 - 69(?: - 0\d\d| - 1(?: - 2[2-9]| - 3[0-5] - )| - 4(?: - 0[89]| - 1[2-6]| - 9\d + (?: + 69(?: + 0\d\d| + 1(?: + 2[2-9]| + 3[0-5] + )| + 4(?: + 0[89]| + 1[2-6]| + 9\d + )| + 6(?: + 1[016-9]| + 5[0-4]| + [67]\d + ) )| - 6(?: - 1[016-9]| - 5[0-4]| - [67]\d - ) + 7090[0-4] )\d{4} @@ -13587,7 +13625,7 @@ 44| 55| 77| - 9[5-7] + 9[5-79] ) ) )\d{4}| @@ -20360,7 +20398,10 @@ mobileNumberPortableRegion="true"> - 590\d{6}| + (?: + 590\d| + 7090 + )\d{5}| (?: 69| 80| @@ -20392,22 +20433,25 @@ 690001234 - 69(?: - 0\d\d| - 1(?: - 2[2-9]| - 3[0-5] - )| - 4(?: - 0[89]| - 1[2-6]| - 9\d + (?: + 69(?: + 0\d\d| + 1(?: + 2[2-9]| + 3[0-5] + )| + 4(?: + 0[89]| + 1[2-6]| + 9\d + )| + 6(?: + 1[016-9]| + 5[0-4]| + [67]\d + ) )| - 6(?: - 1[016-9]| - 5[0-4]| - [67]\d - ) + 7090[0-4] )\d{4} @@ -24807,7 +24851,8 @@ 21(?: 1[013-5]| - 2\d + 2\d| + 3[4-9] )\d{5}| (?: 45| @@ -26776,13 +26821,10 @@ 81234567 - 8(?: - 09[0-689]| - 96[0-2] - )\d{4}| + 896[0-4]\d{4}| (?: 8(?: - 0[1-8]| + 0[1-9]| [1-8]\d| 9[0-5] )| diff --git a/src/metadata/countries.json b/src/metadata/countries.json index cde19ed..2025852 100644 --- a/src/metadata/countries.json +++ b/src/metadata/countries.json @@ -315,7 +315,7 @@ "bj", "Benin", "229", - "+229 (..) ... ..." + "+229 (..) ... ... .." ], [ "bm", diff --git a/src/metadata/validations.json b/src/metadata/validations.json index 92689df..52e9254 100644 --- a/src/metadata/validations.json +++ b/src/metadata/validations.json @@ -88,8 +88,8 @@ "^(?:[267]\\d|31)\\d{6}$" ], "bj": [ - "^\\d{8}$", - "^[24-689]\\d{7}$" + "^\\d{8,10}$", + "^(?:01\\d|[24-689])\\d{7}$" ], "bm": [ "^\\d{10}$", @@ -313,7 +313,7 @@ ], "gp": [ "^\\d{9}$", - "^590\\d{6}|(?:69|80|9\\d)\\d{7}$" + "^(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}$" ], "gq": [ "^\\d{9}$", @@ -941,7 +941,7 @@ ], "bl": [ "^\\d{9}$", - "^590\\d{6}|(?:69|80|9\\d)\\d{7}$" + "^(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}$" ], "cc": [ "^\\d{6,12}$", @@ -965,7 +965,7 @@ ], "mf": [ "^\\d{9}$", - "^590\\d{6}|(?:69|80|9\\d)\\d{7}$" + "^(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}$" ], "sj": [ "^\\d{5,8}$",