From: Elliot Temple Date: 2006-04-29T02:49:10+09:00 Subject: Re: regex loop yields single element array for multiple finds irb(main):090:0* markup = "@@@asdfasdf@@@ @@@ lk;lk@@@" => "@@@asdfasdf@@@ @@@ lk;lk@@@" irb(main):091:0> markup.scan(/@@@/) do |ats| irb(main):092:1* puts ats.length irb(main):093:1> end 3 3 3 3 => "@@@asdfasdf@@@ @@@ lk;lk@@@" irb(main):094:0> On Apr 28, 2006, at 10:26 AM, Xeno Campanoli wrote: > I have a string with say "@@@asdfasdf@@@ @@@ lk;lk@@@" called > markup, and I do: > > markup.scan(/@@@/) do |ats| > print ats.class > print ats.length > end > > and I get the class as always Array, and the length as 1. What's > with that? > > xc > > -- Elliot Temple http://www.curi.us/blog/