From: Sam Kong Date: 2005-03-24T18:09:50+09:00 Subject: Re: (Maybe) a simple question about regex Thank you and other posters for the answers. Actually s.scan(/(?!45)\d\d/) suffices my real problem. 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/) . I think non-RE solution would be better like Mr. Robert Klemme said. But I wanted to learn some RE. Thanks. Sam