From: Csaba Henk Date: 2005-03-25T22:34:47+09:00 Subject: Re: (Maybe) a simple question about regex On 2005-03-24, Sam Kong wrote: > What I was trying to solve was... > 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. > Actually my toy case was not well-defined (I realized this later) and > thus it required more complex solutions like your second case - > s.scan(/(?!45|5)\d\d/) . Why don't you use a dedicated html parser? Eg. there's htmltokenizer, available ar Rubyforge, quite lightweight and very easy to use, but there are others, of course. > I think non-RE solution would be better like Mr. Robert Klemme said. > But I wanted to learn some RE. This thread was useful, I admit :) Csaba