From: nobu.nokada@... Date: 2003-01-31T07:18:48+09:00 Subject: Re: How to do grep -v? Hi, At Fri, 31 Jan 2003 06:49:15 +0900, Jim Freeze wrote: > > > > Is there a more direct way than this to get 'grep -v'? > > > > > > > > c=%w{a b c} #=> ["a", "b", "c"] > > > > c -= c.grep(/a/) #=> ["b", "c"] > > > > > > c.grep(/[^a]/) > > Doesn't work for 'a' being more than one character. > How does one do a negative regex match? Try . require 'reop' c.grep(-/a/) -- Nobu Nakada