From: Xavier Noria Date: 2009-07-17T09:58:37+09:00 Subject: Re: regexp exclusion search - find matches NOT ending with a string? On Fri, Jul 17, 2009 at 2:35 AM, BrendanC wrote: > I have the following text in a file: > > 1 a1.html > 2 b.doc > 3 c.xml > 4 d.tiff > 5 e.jpeg > 6 f.html > .... > > I need a regexp to match lines except those that end with ending in > ".html" The easiest path is to negate that it matches, say for instance: if filename !~ /\.html\z/ # non-HTML here end -- fxn