From 8421feb7573f3bf9a5dbaf3ad61d72a3d7033882 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 20 Nov 2024 14:59:33 +0300 Subject: [PATCH] updated the regex to match all Kenyan numbers --- internal/handlers/ussd/menuhandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/handlers/ussd/menuhandler.go b/internal/handlers/ussd/menuhandler.go index d8e6fa0..ba9a4c6 100644 --- a/internal/handlers/ussd/menuhandler.go +++ b/internal/handlers/ussd/menuhandler.go @@ -37,7 +37,7 @@ var ( // Define the regex patterns as constants const ( - phoneRegex = `(\(\d{3}\)\s?|\d{3}[-.\s]?)?\d{3}[-.\s]?\d{4}` + phoneRegex = `^(?:\+254|254|0)?((?:7[0-9]{8})|(?:1[01][0-9]{7}))$` pinPattern = `^\d{4}$` )