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-]+)+$"");这里的正确格式应该怎么写啊~`