- 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]+)+";//"\w=@\w+(\.\w+)+";
- Pattern p=Pattern.compile(reg);
- while((line=bufr.readLine())!=null)
- {
- Matcher m=p.matcher(line);
- while(m.find())
- {
- System.out.println(m.group());
- }
- }
- }
- }