From: Peter Szinek Date: 2006-10-31T20:00:51+09:00 Subject: Re: Learning Ruby Urzahil wrote: > Hi, I come from a little bit of C programming, an I've just started > learning Ruby. So forgive me for the stupid question. > Following the user guide, I found a regular expression example > (rexg.rb), that doesn't work for me. > If I try to find an exact pattern everything is fine: for example, > searching "foo" in "foobar" returns the correct result. But searching a > regexp pattern doesn't: "fo+" doesn't find anything in "foobar". > I'm running Ruby 1.8 under Linux. > Thank you in advance for your help, Could you provide the examples you have tried? I did not really get you, as for me: irb(main):003:0> "foobar" =~ /foo/ => 0 irb(main):004:0> "foobar" =~ /fo+/ => 0 your example works. Please send the code snippets which did not work for you. Peter http://www.rubyrailways.com