删除所有 包含attribute属性=value值 的标签 连同标签体一起删除

最后更新:2023-10-18 20:54:29 | 状态:未完成
删除所有 包含attribute属性=value值 的标签 连同标签体一起删除 
RegularUtil.removeTagWithBodyByAttributeValue(s,"class","a") 
<input type="text" class="a"/> 
<input type="text" class="a"/></input/> 
<input type="text" class="a b"/></input/>如果需要不匹配可以使用"[^\\s]a[^\\s]" 
<input type="text" class="b a"/></input/> 
<input type="text" class="ab"/></input/>(不匹配)如果需要匹配可以使用"a.*"
/**
* @param src xml/html
* @param attribute 属性
* @param value 值
* @return String
*/
public static String removeTagWithBodyByAttributeValue(String src, String attribute, String value)
最近更新 搜索 提交