Ruby 1.8.1. RegExp documentation?

Greetings!

I’m new to Ruby and also new to RegExp… just as a warning… :wink:

I’m using ruby 1.8.1 on Mac OS X.2.8 and searching for some
understandable documentation about regexp in ruby and regexp in common.
I prefer learning-by-doing, so I found the following URL:
http://www.ntecs.de/old-hp/s-direktnet/ruby/uguide05.html
There is a sample program, that runs fine under ruby 1.6.7, but fails
with the first example (doesn’nt mark anything).

Any hints what changed between 1.6.7 and 1.8.1? Is there any up-to-date
documentation about ruby? 95% are about 1.6.7 and rest is about 1.4…
but where is 1.8.1?

Thanks in advance!
Viktor

···


Mails bitte mit [news] im Betreff einleiten.
ICQ / MSN available

There is a sample program, that runs fine under ruby 1.6.7, but fails
with the first example (doesn'nt mark anything).

Change

     str.gsub! re, "#{st}\\&#{en}"

by

     str.gsub!(/#{re}/, "#{st}\\&#{en}")

Guy Decoux

Great!

Thanks a lot!
Hope I will find such “errors” on my own in a couple of weeks :slight_smile:

Regards,
Viktor

···

ts decoux@moulon.inra.fr wrote:

Change

 str.gsub! re, "#{st}\\&#{en}"

by

 str.gsub!(/#{re}/, "#{st}\\&#{en}")


Mails bitte mit [news] im Betreff einleiten.
ICQ / MSN available