是不是合法手机

来源:互联网 发布:淘宝白名单怎么加入 编辑:程序博客网 时间:2024/06/11 02:49
 /**  * 判断是不是合法手机  * handset 手机号码  */ public static boolean isHandset(String handset) {  try {   if(!handset.substring(0,1).equals("1")) {    return false;   }   if (handset==null || handset.length()!=11) {    return false;   }   String check = "^[0123456789]+___FCKpd___0quot;;   Pattern regex = Pattern.compile(check);   Matcher matcher = regex.matcher(handset);   boolean isMatched = matcher.matches();   if(isMatched) {    return true;   } else {    return false;   }  } catch (RuntimeException e) {   return false;  }  }}
原创粉丝点击