Skip to content

Instantly share code, notes, and snippets.

@richardkeep
Forked from muya/msisdn_regex.txt
Created November 29, 2017 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardkeep/a8645b7bf209971f6934015cf93ff586 to your computer and use it in GitHub Desktop.
Save richardkeep/a8645b7bf209971f6934015cf93ff586 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/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment