Forum: Ruby regex loop yields single element array for multiple finds:

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Xeno C. (Guest)
on 2006-04-28 22:15
(Received via mailing list)
Okay, my string has a parenthesized section, and that is doing it:

markup.scan(/@@@.*?(@@@).*?@@@/) do |ats|
puts ats.length
puts ats.class

is a closer to what I've got.  My apologies.  So, it looks like whenever
you specifiy
a section with parameters you then get an array.  I guess that makes
sense.  Thanks.

This topic is locked and can not be replied to.