From: "list. rb" Date: 2007-06-29T11:40:33+09:00 Subject: Re: Help with regular expression ------=_Part_62657_32456363.1183084828770 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline some_string unless some_string.match("bar") On 6/28/07, Stephen Ball wrote: > > On 6/28/07, dblack@wobblini.net wrote: > > Hi -- > > > > > On Fri, 29 Jun 2007, Jesse Hk wrote: > > > > > Am I missing something here? Why not just test for equality? > > > > > > > > > irb(main):001:0> "foo" == "foo" > > > => true > > > irb(main):002:0> "foo" == "bar" > > > => false > > > > That doesn't cover the case where the string includes the substring > > "bar" but also includes other characters. > > > > > > David > > > > In that case it still works, so we have: > > "foo" => "foo" > > irb(main):001:0> "foo" == "foo" > => true > > "bar " => nil > > irb(main):002:0> "foo" == "bar" > => false > > "foobar" => nil > > irb(main):003:0> "foo" == "foobar" > => false > > -- Stephen > > ------=_Part_62657_32456363.1183084828770--