I would like to find lines in files that include two words, word_1
and word_2
in order, such as in Line A
below, but not as in Line B
or Line C
:
Line A: ... word_1 .... word_2 ....
Line B: ... word_1 ....
Line C: ... word_2 ....
I have tried
$ack '*word_1*word_2'
$ack '(word_1)+*(word_2)+'
and the same commands with ^
appended at the beginning of the regex (in an attempt to follow the Perl regex syntax).
None of these commands return the files or the lines I am interested in.
What am I doing wrong?
Thanks!