I am trying to get an expression that takes a huge few paragraphs and finds lines with two specific words both in that lines, so I am looking for the AND operator? Any way how to do this?
For example:
c <- ("She sold seashells by the seashore, and she had a great time while doing so.")
I want an expression that finds a line with both "sold" and "great" in the line.
I've tried something like:
grep("sold", "great", c, value = TRUE)
Any ideas?
Thanks so much!
You can create two capture groups, assuming the order of the words is unimportant