Last active
February 8, 2022 01:25
-
-
Save TRFN/256b69afb2a898b6ec0bbb605877ff63 to your computer and use it in GitHub Desktop.
Regex for verify if contact number is cell phone or line number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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