Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\D])|(18[0,2,3,5-9])|(17[0-9])|(14[5,7]))\d{8}$"); Matcher m = p.matcher(mobile); // 手机号匹配失败 if (!m.matches()) { return false; } return true;