zero_shubham1

telephoneCheck

Jan 26th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function telephoneCheck(str) {
  2.   // Good luck!
  3.    if(/^[1]*(\s)*([0-9]{3}|\([0-9]{3}\))(\s)*(-)*[0-9]{3}(\s)*(-)*[0-9]{4}/.test(str) && !/^(\([0 2-9]{3}\)[0-9]{8}|[0 2-9]{11})/.test(str))
  4.     return true;
  5.   else
  6.     return false;
  7. }
Add Comment
Please, Sign In to add comment