In order to test if a pattern appears in a string, I found this function (R) :
grepl(pattern,string)
Now I want to specify more characteristics for the pattern:
- OR: it is possible to do "pattern 1|pattern 2"
- AND: is it possible to test if "pattern 1&pattern 2" both appear ? I tested, this expression doesn't work
- also, what if I want "(a|b)&c", etc.
Exemple:
grepl("t","test") # returns TRUE OK
grepl("t|i","test") # returns TRUE OK
grepl("t&e","test") # I want to test if "t" and "e" are both in "test", which is TRUE