Ruby 1.8.1. RegExp documentation?

Discussion in 'Ruby' started by Viktor Zacek, Apr 12, 2004.

  1. Viktor Zacek

    Viktor Zacek Guest

    Greetings!

    I'm new to Ruby and also new to RegExp... just as a warning... ;-)

    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
    Viktor Zacek, Apr 12, 2004
    #1
    1. Advertising

  2. Viktor Zacek

    ts Guest

    >>>>> "V" == Viktor Zacek <> writes:

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

    Change

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

    by

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



    Guy Decoux
    ts, Apr 12, 2004
    #2
    1. Advertising

  3. Viktor Zacek

    Viktor Zacek Guest

    ts <> wrote:

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


    Great!

    Thanks a lot!
    Hope I will find such "errors" on my own in a couple of weeks :)

    Regards,
    Viktor

    --
    Mails bitte mit [news] im Betreff einleiten.
    ICQ / MSN available
    Viktor Zacek, Apr 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cameron Laird
    Replies:
    1
    Views:
    639
    Josiah Carlson
    Apr 3, 2004
  2. Kenneth McDonald
    Replies:
    2
    Views:
    710
  3. Replies:
    1
    Views:
    1,194
    Andy Dingley
    Sep 16, 2006
  4. Mikel Lindsaar
    Replies:
    0
    Views:
    463
    Mikel Lindsaar
    Mar 31, 2008
  5. Joao Silva
    Replies:
    16
    Views:
    338
    7stud --
    Aug 21, 2009
Loading...

Share This Page