/**
* 校验EMAIL格式,真为正确
*
* @author
* @date 2017-7-19
* @param email
* @return true 为格式正确 false 为格式错误
*/
public static boolean emailFormat(String email) {
boolean tag = true;
if (!email.matches("[\\w\\.\\-]+@([\\w\\-]+\\.)+[\\w\\-]+")) {
tag = false;
}
return tag;
}Java 校验EMAIL格式方法,真为正确
最新推荐文章于 2025-09-02 10:08:26 发布
本文介绍了一个简单的Java方法用于验证电子邮件地址的格式是否正确。该方法使用正则表达式来检查输入的字符串是否符合标准的电子邮件格式。如果格式正确,则返回true;否则返回false。
3356

被折叠的 条评论
为什么被折叠?



