import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class EmailSpider {
public static void main(String[] args) {
try {
BufferedReader buf =new BufferedReader(new FileReader("G:\\NHK.htm"));
String str="";
while((str=buf.readLine())!=null){
parsin(str);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
private static void parsin(String str) {
Pattern p = Pattern.compile("[\\w]+@[\\w]+\\.[\\w]+");
Matcher m = p.matcher(str);
while(m.find()){
System.out.println(m.group());
}
}
}