Posted on 2010-04-21 12:30 
leekiang 阅读(288) 
评论(0)  编辑  收藏  所属分类: 
java 、
文件处理 
			 
			
		 
		String regex = "<a.*?/a>";//取链接
        Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
        Matcher mt = pattern.matcher(str);
        while (mt.find()) {
        String s=mt.group();
        }
        String regex2 = ">.*?</a>";// 标题部分
        String regex3 = "imgs/[([0-9])]+.(jpg|gif|png|bmp)";//取图片
输入例子可产生正则表达式
http://sourceforge.net/projects/quickrex/
在线测试
http://www.fileformat.info/tool/regex.htm