From: Stephen Ball Date: 2007-06-29T11:24:59+09:00 Subject: Re: Help with regular expression 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