---------------------- <a href="http://edu.csdn.net/heima" target="blank">android培训</a>、<a href="http://edu.csdn.net/heima" target="blank">java培训</a>、期待与您交流! ----------------------
import java.io.*;
import java.util.regex.*;
class practice33
{
public static void main(String[] args) throws Exception
{
BufferedReader br=new BufferedReader(new FileReader("@.txt"));//传入要爬的信息
String s;
while((s=br.readLine())!=null)
{
Pattern p=Pattern.compile("\\w+@\\w+(.\\w+)+");
Matcher m=p.matcher(s);
while(m.find())
{
System.out.println(m.group());
}
}
}
}
---------------------- <a href="http://edu.csdn.net/heima" target="blank">android培训</a>、<a href="http://edu.csdn.net/heima" target="blank">java培训</a>、期待与您交流! ----------------------
黑马程序员_网页爬虫
最新推荐文章于 2025-01-13 17:58:37 发布