I am looking for a regular expression in Java where I can remove the beginning and end of the angular braces if both are present in the string. e.g. 1
str = "abc <someting> def < 0"
output: "abc someting def < 0"
if there is either open or close then that brace should remain as it is.
e.g. 2
str = "abc <some <thing>> def < 0"
output : "abc some thing def < 0"
I followed other stackoverflow QA but nothing helped me.
Below are the one I tried
"\\<[^\\>]*?\\)"
"\\<|\\>"
Thanks in advance!!!