急求解 验证邮箱:'.'和@符号不能是在第一位。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String content = "[email protected]"; String pattern = "[^\\.^@]+@[^\\.]+.com"; Matcher matcher = Pattern.compile(pattern).matcher(content); if(matcher.matches()){ System.out.println("合法邮箱地址"); }else{ System.out.println("非法邮箱地址"); } String content = "[email protected]"; String pattern = "[^\\.^@]+@[^\\.]+\\.com"; Matcher matcher = Pattern.compile(pattern).matcher(content); if(matcher.matches()){ System.out.println("合法邮箱地址"); }else{ System.out.println("非法邮箱地址"); }更正一下 Java 当调整窗体大小时怎样获取当前的大小值。 大家来讨论一下字符集问题 我先说 char问题 JAVA反编译工具 stringbuffer:api文档中说线程安全的可变字符序列。一个类似于 String 的字符串缓冲区,但不能修改。 一个关于小数位数截取的简单问题 java中的反射机制疑问 这个简单的调用问题 模式设计中的聚集和组合的理解 数据库连接错误 JAVA音频处理 工作查LOG想做个工具自动找但是遇到难题求思路
String pattern = "[^\\.^@]+@[^\\.]+.com";
Matcher matcher = Pattern.compile(pattern).matcher(content);
if(matcher.matches()){
System.out.println("合法邮箱地址");
}else{
System.out.println("非法邮箱地址");
}
String content = "[email protected]";
String pattern = "[^\\.^@]+@[^\\.]+\\.com";
Matcher matcher = Pattern.compile(pattern).matcher(content);
if(matcher.matches()){
System.out.println("合法邮箱地址");
}else{
System.out.println("非法邮箱地址");
}
更正一下