Skip to content

Instantly share code, notes, and snippets.

@ndeto
Created October 22, 2017 19:03
Show Gist options
  • Save ndeto/82f04f860cf950ce3f0fa2a83f21b79d to your computer and use it in GitHub Desktop.
Save ndeto/82f04f860cf950ce3f0fa2a83f21b79d to your computer and use it in GitHub Desktop.
Regex for Kenyan phone numbers in format 07xxxxxxxx
var phoneno = /^(07)([0-9|7])(\d){7}$/;
if (phonenumber.match(phoneno)) {
return true;
} else {
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment