验证邮箱的格式
- // 验证邮箱的格式
- public boolean isEmail(String email) {
- final String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
- final Pattern regex = Pattern.compile(check);
- final Matcher matcher = regex.matcher(email);
- return matcher.matches();
- }