perl -ne "print $_ if m:xxx: && (m:yyy: || m:zzz: )" input.txt