/**
* 提取HTML标签的属性值
* @param source HTML标签内容
* "<span rid="1177217865" __cid="cJ3e2aq" class="cJ3e2aq">@苍井空 </span>"
* @param element 标签名称 a
* @param attr 标签属性 title
* @return
*/
public static List<String> match(String source, String element, String attr) {
List<String> result = new ArrayList<String>();
String reg = "<" + element + "[^<>]*?\\s" + attr + "=['\"]?(.*?)['\"]?\\s.*?>";
Pattern pt = Pattern.compile(reg);
Matcher m = pt.matcher(source);
while (m.find()) {
String r = m.group(1);
result.add(r);
}
return result;
}