正则表达式抓取网页中邮箱

1.废话不说,看代码
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class EmailRegexDemo {

    private static final String TARGET_URL = "http://tieba.baidu.com/p/2314539885";

    public static void main(String[] args) {
        try {
            String content = HttpUtils.get(TARGET_URL, null);
            Matcher matcher = Pattern.compile(PatternUtils.EMAIL_REGEX).matcher(content);
            while (matcher.find()) {
                System.out.println(matcher.group());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}   

代码地址(码云):https://gitee.com/jsjack_wang/JavaDemo

你可能感兴趣的:(正则表达式抓取网页中邮箱)