package compile;
import java.util.regex.*;public class compile1 {
public static void main(String args[]) {
Pattern pattern = Pattern.compile(""^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"");
String s="[email protected]
Matcher matcher = pattern.matcher(s);
if (matcher.find())
{
System.out.println(matcher.group());
}
else
{
System.out.println("格式不匹配");
}
}
}Pattern pattern = Pattern.compile(""^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"");这里的正确格式应该怎么写啊~`
import java.util.regex.*;public class compile1 {
public static void main(String args[]) {
Pattern pattern = Pattern.compile(""^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"");
String s="[email protected]
Matcher matcher = pattern.matcher(s);
if (matcher.find())
{
System.out.println(matcher.group());
}
else
{
System.out.println("格式不匹配");
}
}
}Pattern pattern = Pattern.compile(""^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$"");这里的正确格式应该怎么写啊~`
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货