public static void main(String[] args) {
try {
BufferedReader br=new BufferedReader(new FileReader("E:\\share\\10433633.html")); //读取文件
String line="";
while(br.readLine() != null){
Pattern p=Pattern.compile("[\\w[.-]]+@[\\w[.-]]+\\.[\\w]+"); //匹配email的表达式
Matcher m=p.matcher(line);
while(m.find()){
System.out.println(m.group()); //分组打印出来
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
try {
BufferedReader br=new BufferedReader(new FileReader("E:\\share\\10433633.html")); //读取文件
String line="";
while(br.readLine() != null){
Pattern p=Pattern.compile("[\\w[.-]]+@[\\w[.-]]+\\.[\\w]+"); //匹配email的表达式
Matcher m=p.matcher(line);
while(m.find()){
System.out.println(m.group()); //分组打印出来
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}