From: "Maurício Antunes" Date: 2002-08-07T20:10:14+09:00 Subject: Re: Very ineficient regular expression match 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" 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 > >