I am trying to remove brackets from a string like the one below.
library(stringr)
x <- "(Verhoeff,1937)"
str_replace(string = x, pattern = "(\\()|(\\))", replacement = "")
[1] "Verhoeff,1937)"
gsub(pattern = "(\\()|(\\))", replacement = "", x = x)
[1] "Verhoeff,1937"
str_replace
doesn't seem to find the closing bracket?
Any ideas why?