How to search file with the ack
to find lines containing ALL (nor any) of defined patterns?
the ANY (OR) is easy, like:
ack 'pattern1|pattern2|pattern3'
but how to write the AND (ALL) ? e.g. how to write the following:
if( $line =~ /pattern1/ && $line =~ /pattern2/ && $line =~ /pattern3/ ) {
say $line
}
using ack
?
Or more precisely, is possible create an regex with logical and
?