Reputation: 32391
I try to use the String.replaceAll
method for replacing a String like <br>
with <br/>
. Because <br>
can be something more complicated like <br style="">
, I need the same regex to work on both cases.
I tried something like:
String s = "<something><br><br style=\"\"></something>";
s = s.replaceAll("<br(.*)>", "<br$1/>");
but it doesn't seem like I am very successful.
Upvotes: 0
Views: 51