Reputation: 2045
I have a string containing some HTML content. I want to replace all the HTML tags and the content within them using Regex in java.
So for example <a>
,<a href=""/>
,</a>
etc. should be removed.
I tried
str=str.replaceAll("<\\w*>","");
but it replaces only the first occurrence from the string.
How can I replace all the occurrences of this kind from the string. Thanks
Upvotes: 0
Views: 263