Bug #1873: MatchData#[]: Omits All But Last Captures Corresponding to the Same Named Group
http://redmine.ruby-lang.org/issues/show/1873

Author: Run Paint Run Run
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.2dev (2009-08-03 trunk 24372) [i686-linux]

I suspect that MatchData#[:symbol] should return an Array of values when the same named group has been matched multiple times.

  >> m = 'food'.match(/(?<f>oo)(?<f>d)/)
  => #<MatchData "ood" f:"oo" f:"d">
  >> m[:f]
  => "d"
  >> m.to_a
  => ["ood", "oo", "d"]


----------------------------------------
http://redmine.ruby-lang.org