I have a paragraph of text something like this
"Lots of stuff written about <a href="figures/Climate.png" rel="lightbox" title="Figure 2.1">Figure 2.1</a> but i want to remove the link"
I want to use the R functions sub/gsub or tidyverses stringr to end up with
"Lots of stuff written about Figure 2.1 but i want to remove the link"
I can't seem to find the regular expression to match the "<a ....>" etc.
I used to use perl for this kind of stuff (but it's been a while) so i am interested in doing this in R.
Now i use
stringr::str_match_all(aline,"<a[^>]+href=\"(.*?)\"[^>]*>(.*?)</a>")
to select all of the linked items and the urls, but can't work out how to remove the content.