str.scan(pattern) â arraystr.scan(pattern) {|match, ...| block } â str
Instance Public methods
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 co