//提取所有图片内容
String contentValue = "<img src='aaa/bbb/ccc/test.jpg' />";
Pattern p = Pattern.compile("<img[^>]+src\\s*=\\s*['\"]([^'\"]+)['\"][^>]*>");
Matcher m = p.matcher(contentValue.toLowerCase());
while (m.find()) {
System.out.println(m.group(1));
}
//处理超链接
String contentValue = "<a href="/n2669700/n5326028/n5326101/n5328096/n5328138/n6046427.files/n6046428.doc">B超中标.doc</a>";
Pattern p1 = Pattern.compile("<a\\s.*?href=\"([^\"]+)\"[^>]*>(.*?)</a>");
Matcher m1 = p1.matcher(contentValue);
while(m1.find()){
System.out.println(m1.group(1)+" --> "+m1.group(2));
}
String contentValue = "<img src='aaa/bbb/ccc/test.jpg' />";
Pattern p = Pattern.compile("<img[^>]+src\\s*=\\s*['\"]([^'\"]+)['\"][^>]*>");
Matcher m = p.matcher(contentValue.toLowerCase());
while (m.find()) {
System.out.println(m.group(1));
}
//处理超链接
String contentValue = "<a href="/n2669700/n5326028/n5326101/n5328096/n5328138/n6046427.files/n6046428.doc">B超中标.doc</a>";
Pattern p1 = Pattern.compile("<a\\s.*?href=\"([^\"]+)\"[^>]*>(.*?)</a>");
Matcher m1 = p1.matcher(contentValue);
while(m1.find()){
System.out.println(m1.group(1)+" --> "+m1.group(2));
}