Skip to content

Instantly share code, notes, and snippets.

@SergeyMaas
Created October 28, 2015 21:04
Show Gist options
  • Save SergeyMaas/0784944d9086df576962 to your computer and use it in GitHub Desktop.
Save SergeyMaas/0784944d9086df576962 to your computer and use it in GitHub Desktop.
/*
Валидация номера моб.телефона
*/
function validateMobilePhoneNumBer(phone){
if(phone !== undefined)
{
var regExp = /^((\+?7|8)?) \((900|901|902|903|905|906|908|909|910|911|912|913|914|915|916|917|918|919|920|921|922|923|924|925|926|927|928|929|929|930|931|932|933|934|935|936|937|938|939|941||950|951|952|953|954|955|956|958|960|961|962|963|964|965|966|967|968|969|970|971|976|980|981|982|983|984|985|986|987|988|989|991|992|993|994|995|996|997|999)\) ?(\d{3}\-?\d{4})$/;
var result = phone.match(regExp);
return result && result[0] == phone;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment