package com.mfl;
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 {
/**
* @param args
*/
public static void main(String[] args) {
try {
BufferedReader read= new BufferedReader(new FileReader("E://Source//MyEclipse//RegularExpression//需要wallop、orkut邀请的朋友,请留下mail和用户名 - 鱼上游 - BlogJava.htm"));
String line="";
while((line=read.readLine())!=null){
Pattern p= Pattern.compile("[//w[.-]]+@[//w[.-]]+[//w]+");
Matcher m=p.matcher(line);
while(m.find()){
System.out.println(m.group());
}
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}