public static boolean isMobileNum(String mobiles){
  Pattern p=Pattern.compile("^((13[0-9])|(15[^4,\\D])|(17[^4,\\D])|(18[0-9]))\\d{8}$");
  Matcher m=p.matcher(mobiles);
  return m.matches();
}

public static boolean isMobileNum ( String mobiles ) { Pattern p = Pattern . compile ( "^((13[0-9])|(15[^4,\\D])|(17[^4,\\D])|(18[0-9]))\\d{8}$" ) ; Matcher m = p . matcher ( mobiles ) ; return m . matches ( ) ; }
check whether mobile num is legal in mainland china
