From: Mr Jaba Date: 2012-01-13T00:27:48+09:00 Subject: Re: negative grep --14dae9473a73e5e71204b6566352 Content-Type: text/plain; charset=ISO-8859-1 Or there's a complicated Regex feature called negative lookarounds, bit more info here: http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word Which given: a = ["abc", "def", "ghi"] a.grep(/^((?!abc).)*$/) => ["def", "ghi"] On 12 January 2012 15:22, K Clair wrote: > biglist !~ /bar/ > > !biglist.grep(/bar/) > > > On Fri, 13 Jan 2012 00:15:24 +0900, Matt Lawrence wrote: > >> A bit of syntax that I have never picked up. How do I use grep to >> exclude entries in a list? >> >> biglist.grep(/foo/) # get all entries containing foo >> biglist.grep(????) # get all entries that do not contain bar >> >> -- Matt >> It's not what I know that counts. >> It's what I can remember in time to use. >> > > > --14dae9473a73e5e71204b6566352--