import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class GetEmail {
public static void getEmail() {
File file = new File("E://itxm/email.txt");
try{
BufferedReader br = new BufferedReader(new FileReader(file));//构造一个BufferedReader类来读取文件
String s = null;
while((s = br.readLine())!=null){//使用readLine方法,一次读一行
Pattern pattern = Pattern.compile("[^0-9]");
Matcher matcher = pattern.matcher(s);
String email = matcher.replaceAll("");
if(!"".equals(email)&&email.length()>5){
System.out.println(email+"@qq.com");
}
}
br.close();
}catch(Exception e){
e.printStackTrace();
}
}
public static void main(String[] args) {
getEmail();
}
}