您的位置:首页 > 运维架构 > 网站架构

网站的email地址

2016-04-15 19:31 316 查看
<span style="font-size:18px;">package cn.itcast.test;

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;

//统计某网站的email地址,可以发垃圾邮件
//Spider--   这种程序蜘蛛程序
public class Demo2 {

public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new FileReader("E:\\java_eclipes\\wordspace\\RegExp\\src\\file\\回复:【坐等更新。。。。谁要1__464 。 留Email 】_王爷要休妃吧_百度贴吧.html"));
String line = "";
while((line=br.readLine())!=null){
parse(line);
}

} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

}

private static void parse(String line) {
Pattern p = Pattern.compile("[\\w[.-]]+@[\\w[.-]]+\\.[\\w]+");
Matcher m = p.matcher(line);
while(m.find()){
System.out.println(m.group());
}
}
}</span>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: