# NOT RUN {
# create an expression
x <- find(value = "foo") %>%
or(find(value = "bar"))
# create strings
string1 <- "foo!"
string2 <- "bar!"
# extract matches
regmatches(string1, gregexpr(x, string1))[[1]]
regmatches(string2, gregexpr(x, string2))[[1]]
# }
Run the code above in your browser using DataLab