Consider this simple example url
http://this-is-a-nice-example/2020.htm
I am trying to write a regex that replaces the last /
with an empty space, so that the url
actually reads http://this-is-a-nice-example2020.htm
Unfortunately, the regex below returns a surprising result
> str_replace('http://this-is-a-nice-example/2020.htm', regex('example([/])20'), '' )
[1] "http://this-is-a-nice-20.htm"
Any ideas? Thanks!