From: Simon Strandgaard Date: 2005-03-24T20:00:22+09:00 Subject: Re: (Maybe) a simple question about regex On Thu, 24 Mar 2005 18:09:50 +0900, Sam Kong wrote: > To extract url's from an html source which includes list of sites. > They are formatted like . > But I wanted to exclude from the list. > So (?!index.html) will do. does this help? ary=%w(a.html index.html other.txt evil.html.exe stuff.html) ary.select{|s| s =~ /\A(?!index).*\.html\z/ } #=> ["a.html", "stuff.html"] -- Simon Strandgaard