in reply to multiple regex logical AND
perl -nle 'print $ARGV if !$seen{$ARGV}++ ;print if /^JRECOV="yes"/&&/ +^TEOJ=-w"/'
Hmm.. but is it possible that two strings match the beginning of a line? Yes, if you slurp the file or use paragraph mode and use the m and s modifiers (see perlre):
perl -n00 -le 'print $ARGV if !$seen{$ARGV}++ ;print if /^JRECOV="yes" +/ms &&/^TEOJ=-w"/ms'
--shmem
update: corrected glitch with || and &&
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: multiple regex logical AND
by bigswifty00000 (Beadle) on Dec 12, 2006 at 20:22 UTC | |
by Joost (Canon) on Dec 12, 2006 at 20:24 UTC | |
|
Re^2: multiple regex logical AND
by bigswifty00000 (Beadle) on Dec 12, 2006 at 20:30 UTC | |
by shmem (Chancellor) on Dec 12, 2006 at 22:26 UTC |