[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02025] Re: Ruby Syntax similar to other languages?

From: matz@... (Yukihiro Matsumoto)
Date: 2000-03-19 21:52:00 UTC
List: ruby-talk #2025
Hi,

In message "[ruby-talk:02024] Re: Ruby Syntax similar to other languages?"
    on 00/03/19, ts <decoux@moulon.inra.fr> writes:

|> If 'g' was an attribute of Regexp, then what would
|> 
|>     line =~ /asdf/g
|> 
|> mean?
|
| while line =~ /asdf/g
|    print "#$&\n"
| end
|
|it's more perl than ruby, sorry

Adding 'g' as a Rexexp option makes me feel like Perl.  We have
String#scan for this particular purpose.

  line.scan(/asdf/) do
    print "#$&\n"
  end

In This Thread

Prev Next