Skip to content

Instantly share code, notes, and snippets.

@muya
Created February 28, 2016 16:06
Show Gist options
  • Save muya/ce5a18a3f119cc4ac286 to your computer and use it in GitHub Desktop.
Save muya/ce5a18a3f119cc4ac286 to your computer and use it in GitHub Desktop.
Regex for Safaricom Kenya, Airtel Kenya & Tigo Tanzania Phone Numbers
# KE
SAFARICOM: "/(\+?254|0|^){1}[-. ]?[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}\z/"
AIRTEL: "/(\+254|0|^){1}[-. ]?[7]{1}([3]{1}[0-9]{1}|[8]{1}[5-9])[0-9]{6}\z/"
# TZ
TIGO: "/(\+?255|0|^){1}[-. ]?([7]{1}[1]{1}[2-9]{1}|[6]{1}[57]{1}[2-9]{1})[0-9]{6}\z/"
@ngugijames
Copy link

Asante 👍 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment