Skip to content

Instantly share code, notes, and snippets.

@TRFN
Last active February 8, 2022 01:25
Show Gist options
  • Save TRFN/256b69afb2a898b6ec0bbb605877ff63 to your computer and use it in GitHub Desktop.
Save TRFN/256b69afb2a898b6ec0bbb605877ff63 to your computer and use it in GitHub Desktop.
Regex for verify if contact number is cell phone or line number
function is_cellphone(number){
return(/^\(?[0-9]?[0-9]?\)?\s?[5-9][0-9]{7,8}$/i.test(number));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment