# Regex loop yields single element array for multiple finds:

**URL:** <https://www.ruby-forum.com/t/regex-loop-yields-single-element-array-for-multiple-finds/94324>\
**Category:** Ruby\
**Created:** [April 28, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/regex-loop-yields-single-element-array-for-multiple-finds/94324 "2006-04-28T20:15:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xeno\_C](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@Xeno\_C](https://www.ruby-forum.com/u/Xeno_C)\
**Post date:** [April 28, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/regex-loop-yields-single-element-array-for-multiple-finds/94324/1 "2006-04-28T20:15:31Z")

</div>

Okay, my string has a parenthesized section, and that is doing it:

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

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.

xc
