Suppose I have an original string that looks like:
str1 = "erewrer<.rer>r33e<erer>re<><>rer\nrer<ew212>"
I want to get rid of all those discrete <...>s to get
"erewrerr33ererer\nrer"
I tried StringReplace
StringReplace[str1, "<" ~~ __ ~~ ">" -> ""]
but it produced
"erewrer"
which is the result with the outermost <...> removed.
What should I do?
StringReplace[str1, RegularExpression["<(?s).+?>"] -> ""]– J. M.'s missing motivation Feb 23 '16 at 05:30