I have a string in R:
c("FLT1", "FLT1P1", "FLT1-FLT2", "SGY-FLT1, GPD")
I want to keep all matches that have FLT1 but not when other alphanumeric characters are added. In other words, I want to keep all entries except the second one, as all of them mention FLT1, but the second one mentions FLT1P1.
When I use str_detect, it returns everything as true:
str_detect(string, "FLT1")
[1] TRUE TRUE TRUE TRUE
Can anyone advise on the best method to only return the items that mention FLT1?