------------------------------------------------------------------------
Both forms iterate through _str_, matching the pattern (which may
be a +Regexp+ or a +String+). For each match, a result is generated
and either added to the result array or passed to the block. If the
pattern contains no groups, each individual result consists of the
matched string, +$&+. If the pattern contains groups, each
individual result is itself an array containing one entry per
group.