Skip to content

Instantly share code, notes, and snippets.

@morrismukiri
Last active June 19, 2024 06:05
Show Gist options
  • Save morrismukiri/920494322a47d9485bbc to your computer and use it in GitHub Desktop.
Save morrismukiri/920494322a47d9485bbc to your computer and use it in GitHub Desktop.
Kenyan phone number regular expression
@LukeNgirubiu
Copy link

LukeNgirubiu commented May 4, 2024 via email

@ElzaCremin
Copy link

ElzaCremin commented May 15, 2024

Can I also ask a question because I have some doubts about it? Last semester, I was under immense pressure to finish my dissertation. I found https://ukwritings.com/write-my-dissertation and they came to my rescue. Their writers are experts in various fields, and they delivered a well-structured dissertation on time. The service was worth every penny, and I couldn't be happier with the result.

@obbyK
Copy link

obbyK commented Jun 14, 2024

Works with Java, but you can probably simplify them further.

Safaricom (\\+?254|0)?([7][0129][0-9]|[7][4][0123568]|[7][5][789]|[7][6][89]|[1][1][012345]){1}[0-9]{6}
Airtel (\\+?254|0)?([7][38][0-9]|[7][5][0123456]|[7][6][2]|[1][0][012345678]){1}[0-9]{6}
Telkom (\\+?254|0)?(77[0-9]){1}[0-9]{6}
Faiba (\\+?254|0)?(747){1}[0-9]{6}
Equitel (\\+?254|0)?(76[3456]){1}[0-9]{6}

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