From: George Ogata Date: 2002-07-04T04:54:15+09:00 Subject: Block with Regexp#match Since Regexp#match so far does not use a block, why not extend it to iterate over all the (non-overlapping) matches in the string? I think the following sums up what I mean: -------------------- class Regexp def match(str) if block_given? str.gsub!(self) {|s| yield $~; s} self else old_match(str) # the current Regexp#match end end end -------------------- /<(.*?)>/.match('') {|m| puts m[1]} ....seems pretty intuitive to me. Is this a bad idea?