I have a dataframe where I want to delete all rows with specific pattern. I am confused with compiling a regular expression.
Data:
structure(list(id = 1:5, email = c("1@gmail.com", "2@gmail.com",
"3@gmail.com", "4@pattern.com", "5@pattern.com")), class = "data.frame", row.names = c(NA,
-5L))
What I am trying to do is:
data <- data %>%
filter(email != ".+@pattern.com")
But something is wrong with my regex. What is the most effective way to compose a regular expression for such patterns? What is the proper regex pattern for my sample case?