//判断是否是正常手机号码 private boolean isMobile(String mobiles) { Pattern p = Pattern.compile("^1(3|5|7|8|4)\\d{9}"); Matcher m = p.matcher(mobiles); return m.matches(); } 判断是否是正常邮箱 private boolean isEmail(String email) { Pattern p = Pattern.compile("^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$"); Matcher m = p.matcher(email); return m.matches(); }