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
![]()
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