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 <kclair / pickledradish.com> 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.
>>
>
>
>