I am crazy about this question. In R language regex, how to match a pattern "_a (b)"? a and b both stand for a word, there is a space in front of (.
library(stringr)
x <- c("dum_drop (words)", "apple")
# I want to match and remove the part "_drop (words)"
str_remove(x, pattern = "[_drop (words)]")
# result
# [1] "um_drop (words)" "aple"
I think the regex expression about the pattern "_drop (words)" needs some work.