public class input{
public static boolean match(String str) {
if(str.matches("[\\w]+(.[\\w]+)*@[\\w]+(.[\\w])+")) {
return true;
}
else
{
return false;
}
}
public static void main(String[] args) {
System.out.println(match("abc_Wang.dd.cc@sian.com"));
}
}
运用正则表达式来匹配邮箱
最新推荐文章于 2024-04-22 10:31:29 发布