From: Philip Hallstrom Date: 2007-06-29T04:00:00+09:00 Subject: Re: Help with regular expression > How can I make a regular expression that will match everything, unless > it contains a certain string then it will match nothing. > > For instance, let's say it should not match "bar", then: > > "foo" => "foo" > "bar " => nil > "foobar" => nil some_string !~ /bar/ -philip