I am able to remove everything between "<>" and "</>" using:
gsub("(<[^>]*>)","",abc)
I do not work with regex and can't figure out how to ignore a specific string.
My goal is to make a function where a user can supply values to ignore (i.e., ""), and then remove all values between "<>" or "</>" besides the ignored values.
character_vector <- c("<br>Hello</br>", "I want to keep this <important text>")
character_vector <- gsub("(<[^>]*>)","",character_vector)
Current Output:
[1] "Hello" "I want to keep this "
Ideal Output:
[1] "Hello" "I want to keep this <important text>"