// checkEmail判断邮箱格式
public boolean checkEmail(String email) {
Pattern pattern = Pattern
.compile("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\\.([a-zA-Z0-9_-])+)+$");
Matcher matcher = pattern.matcher(email);
if (matcher.matches()) {
return true;
}
return false;
}
转载于:https://www.cnblogs.com/anjon520/p/3249909.html