/**
* call-seq:
* rxp.scan(str) # => [matchdata1, matchdata2,...] or nil
* rxp.scan(str) {|match_data| ... } # => [matchdata1, matchdata2,...] or nil
*
* Both forms iterate through _str_, matching the pattern. For each match,
* a MatchData object is generated and passed to the block, and
* added to the resulting array of MatchData objects.
*
* If _str_ does not match pattern, _nil_ is returned.
*
**/
static VALUE oregexp_m_scan(VALUE self, VALUE str) {