I try to take a line with HTML, cross out some tags (img, object) and all other HTML tags, cross out their attributes. For instance:
<div id="someId" style="color: #000000"> <p class="someClass">Some Text</p> <img src="images/someimage.jpg" alt="" /> <a href="somelink.html">Some Link Text</a> </div>
It would be:
<div> <p>Some Text</p> Some Link Text </div>
I'm trying to:
string.replaceAll("<\/?[img|object](\s\w+(\=\".*\")?)*\>", "");
I am not sure how to remove all attributes inside the tag.
Any help would be appreciated.
Thanks.
source share