From 315c7919db1e112d4af870654e9f1aa8e90fdfc0 Mon Sep 17 00:00:00 2001 From: imKrishh Date: Fri, 9 Sep 2022 20:42:59 +0530 Subject: [PATCH 1/2] fix(isMobilePhone): update phone regex for Zambia --- src/lib/isMobilePhone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 3c38d2519..321d30e2a 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -65,7 +65,7 @@ const phones = { 'en-UG': /^(\+?256|0)?[7]\d{8}$/, 'en-US': /^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/, 'en-ZA': /^(\+?27|0)\d{9}$/, - 'en-ZM': /^(\+?26)?09[567]\d{7}$/, + 'en-ZM': /^(\+?26)?0[79][567]\d{7}$/, 'en-ZW': /^(\+263)[0-9]{9}$/, 'en-BW': /^(\+?267)?(7[1-8]{1})\d{6}$/, 'es-AR': /^\+?549(11|[2368]\d)\d{8}$/, From f21d8399bf3588e3ab7dd40130e8cd5bee743f40 Mon Sep 17 00:00:00 2001 From: imKrishh Date: Sat, 10 Dec 2022 22:58:08 +0530 Subject: [PATCH 2/2] fix(isMobilePhone): update zambia phone test --- test/validators.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/validators.js b/test/validators.js index 87f73ccd4..db2316314 100644 --- a/test/validators.js +++ b/test/validators.js @@ -7474,6 +7474,8 @@ describe('Validators', () => { '+260966684590', '+260976684590', '260976684590', + '+260779493521', + '+260760010936', ], invalid: [ '12345', @@ -7481,6 +7483,7 @@ describe('Validators', () => { 'Vml2YW11cyBmZXJtZtesting123', '010-38238383', '966684590', + '760010936', ], }, {