You did not precise what result you are expecting. I guess you want all element in Text except n which does not have any of toto, percentage or instance. For that in the regex you need to use an OR clause, i.e |
You can do that with str_subset in stringr for example.
Text <- c("instance", "percentage", "n", "instance tes percentage toto", "percentage gff instance")
stringr::str_subset(Text, "instance|percentage|toto")
#> [1] "instance" "percentage"
#> [3] "instance tes percentage toto" "percentage gff instance"
Created on 2018-07-24 by the reprex package (v0.2.0).
If you want to use grep and friends, just adapt and reword you regex. This kind of website can be of help: https://regexr.com/, https://regex101.com/.
Also, this
can be of big help: