You're right, I didn't know it.
    Anyway, just for educational purposes, I'm still curious about why my
class didn't work well.

    Thanks,
    Maur?cio

----- Original Message -----
From: "Joel VanderWerf" <vjoel / PATH.Berkeley.EDU>
Newsgroups: gmane.comp.lang.ruby.general
Sent: Wednesday, August 07, 2002 1:35 AM
Subject: Re: Very ineficient regular expression match


> Maur?cio wrote:
> > Hi,
> >
> >     The following code is supposed to print multiple regular expression
> > matches on a given string:
>
> Why not use scan?
>
>    "foo bar baz".scan(/\w\w\w/) { |str| puts str }
>
>        # ==> foo
>        #     bar
>        #     baz
>
>