I have try restString = restString.replaceAll("\<.*\>", "");
and
restString = restString.replaceAll("\<[^(\>)]*\>", "");
.
Both seems don’t work. I don’t know if I could represent the meaning in the regular expression.
Advertisement
Answer
Make your regex non-greedy
:
restString = restString.replaceAll("(?s)<.*?>", "");
Also I used (?s)
to make dot match newlines as well.