日期:2014-05-19 浏览次数:20662 次
public static void main(String[] args) throws Exception {
String str= "<div onclick=''>adfadfasdf</div><a>aaaaaaaaaaaaa</a><p>adfadfasdf</p><img src=''/>";
str = str.replaceAll("(?is)<(?!/?(a
------解决方案--------------------
img)).*?>", "");
System.out.println(str);
}