Java regex to strip out XML tags, but not tag contents
You were almost there ;)
Try this:
str = str.replaceAll("<.*?>", "")
"How now <fizz>brown</fizz> cow.".replaceAll("<[^>]+>", "")
You were almost there ;)
Try this:
str = str.replaceAll("<.*?>", "")
"How now <fizz>brown</fizz> cow.".replaceAll("<[^>]+>", "")