From: Joel VanderWerf Date: 2006-03-29T05:09:22+09:00 Subject: Re: Regexp to match strings that _don't_ being with a string Wes Gamble wrote: > I have a new wrinkle. > > Now I want to match any line that doesn't have "xyz" or "abc" at the > beginning of the line. > > Is there a way to "AND" together the input to the negative lookahead > assertion? For lookaheads, you can get AND by concatenating: irb(main):001:0> /^(?!abc)(?!xyz)/ =~ "abc" => nil irb(main):002:0> /^(?!abc)(?!xyz)/ =~ " abc" => 0 irb(main):003:0> /^(?!abc)(?!xyz)/ =~ "xyz" => nil irb(main):004:0> /^(?!abc)(?!xyz)/ =~ " xyz" => 0 -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407