package com.neil.regex;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class EmailFind {

/**
 * 抓取网页中的电子邮件
 * @param args
 */
	public static void main(String[] args) {
		try {
			BufferedReader br=new BufferedReader(new FileReader("C:\\20.htm"));
			String lin="";
			while((lin=br.readLine())!=null){
				 Pattern p=Pattern.compile("(\\w+(-\\w+)*)@(\\w+(-\\w+)*)(\\.(\\w+(-\\w+)*))+"); 
				 Matcher m=p.matcher(lin);
				 while(m.find()){
					 System.out.println(m.group()); 
				 }
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
最近下载更多
ndybaidu  LV20 2018年3月7日
Musajan  LV21 2017年1月3日
1729226869  LV2 2016年6月22日
kele520  LV1 2016年5月10日
狼行天下  LV18 2015年3月16日
wentao  LV24 2014年9月8日
最近浏览更多
Shengyi188 2023年12月18日
暂无贡献等级
heqian  LV16 2022年12月5日
是数据库  LV3 2021年3月31日
徐天堂  LV2 2021年2月23日
小学生波波  LV19 2020年6月8日
kong.yee  LV40 2020年4月26日
吼吼大帝  LV2 2019年10月23日
魔鬼小玄  LV1 2019年10月13日
gtlishujie  LV7 2019年4月17日
huangzeping  LV2 2019年3月14日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友