In a text which have formating labels such as
data.frame(id = c(1, 2), text = c("something here <h1>my text</h1> also <h1>Keep it</h1>", "<h1>title</h1> another here"))
How can someone keep with a comma separate option only the text exist inside in <h1> </h1>:
data.frame(text = c("my text, Keep it", "title"), id = c(1, 2))