- import java.util.regex.*;  
- import java.io.*;  
- class L  
- {  
-     public static void main(String[] args) throws Exception  
-     {  
-         getMail();  
-     }  
-     public static void getMail() throws Exception  
-     {  
-         BufferedReader bufr=new BufferedReader(new FileReader("m.txt"));  
-         String line=null;  
-         String reg="[a-zA-Z_0-9]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";  
-         Pattern p=Pattern.compile(reg);  
-           
-         while((line=bufr.readLine())!=null)  
-         {  
-             Matcher m=p.matcher(line);  
-             while(m.find())  
-             {  
-                 System.out.println(m.group());  
-             }  
-         }  
-   
-     }  
- }   
 
		 
		posted @ 
2013-08-08 18:54 
成风魄郎 
阅读(
376) 
评论() 
 
收藏 
举报