使用java正则表达式提取文本中所有邮箱地址

时间:2025-03-09 08:03:10
package ;
 
import ;
import ;
import ;
import ;
 
import ;
 
/**
 * 提取邮件地址
 * @author Winter Lau
 * @date 2010-6-14 下午04:56:15
 */
public class EmailParser {
     
    private final static Pattern emailer = ("\\w+?@\\w+?.com");
     
    /**
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        String txt = (new File(args[0]));
        //(txt);
        Matcher matchr = (txt);
        while (()) {
            String email = ();
            (email);
        }
    }
 
}


转自:/code/snippet_12_544