Oops, misread the question and your code. I tought he was looking for
all lines the did not contain "joe" or "fred". Sleep dep sucks.
On 22 Jun 2001 08:55:52 -0700, Wagner-David wrote:
> Is this not saying Add if neither joe and fred are in the line while
> what is desired is Joe yes, Fred No ?
>
> Wags ;)
>
> -----Original Message-----
> From: Chas Owens [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 22, 2001 08:50
> To: [EMAIL PROTECTED]
> Subject: Re: 2 regex questions
>
>
> On 22 Jun 2001 16:26:43 +0200, Aaron Craig wrote:
> > At 09:49 22.06.2001 -0400, Yacketta, Ronald wrote:
> > >Folks,
> > >
> > >Is this syntax correct for finding multiple words in a line?
> > > $results{$test}++ if /$test/ && /Factory/ && /failed/;
> >
> > Looks good.
> >
> > >also, what would the syntax be to find a word in a line that does
> > >not contain another word? something similar to
> > > grep joe output | grep -v fred
> >
> > $results{$test}++ if($_ =~ /joe/ && $_ !~ /fred/);
> > Aaron Craig
> > Programming
> > iSoftitler.com
> >
> >
>
> I think you can write this as
>
> $results{$test}++ if (not /(joe|fred)/);
>
> --
> Today is Pungenday, the 27th day of Confusion in the YOLD 3167
> Fnord.
>
>
--
Today is Pungenday, the 27th day of Confusion in the YOLD 3167
Hail Eris!