From a513deb9de36677431c6f0d58563bb75d2b085e6 Mon Sep 17 00:00:00 2001 From: Kishan Soni Date: Mon, 28 Oct 2024 02:16:18 +1000 Subject: [PATCH] Update phone regex for Zambia (#2482) --- src/lib/isMobilePhone.js | 2 +- test/validators.test.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index e9932caa7..53c0e3717 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -70,7 +70,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}$/, diff --git a/test/validators.test.js b/test/validators.test.js index 4df91395c..6b61c18b7 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -8777,6 +8777,8 @@ describe('Validators', () => { '+260966684590', '+260976684590', '260976684590', + '+260779493521', + '+260760010936', ], invalid: [ '12345', @@ -8784,6 +8786,7 @@ describe('Validators', () => { 'Vml2YW11cyBmZXJtZtesting123', '010-38238383', '966684590', + '760010936', ], }, {