From: Run Paint Run Run Date: 2009-08-05T15:17:03+09:00 Subject: [ruby-core:24774] [Bug #1873] MatchData#[]: Omits All But Last Captures Corresponding to the Same Named Group Issue #1873 has been updated by Run Paint Run Run. > Oh sorry, i misunderstood. I think you wanted to access "b" with /(?\w)+/.match("abc"). That's quite alright. :-) > Anyway however, changing return value from alwasy String to String or Array is difficult because of > compatibility. Hmmm... That's unfortunate MatchData#[] is a lovely API. I guess one approach is to return an Array when there are multiple matches; a String otherwise. Anybody who currently relies on only the last match being returned is both in the minority and taking advantage of a bug. But I confess not to being overly fond of this solution. :-/ I'm not sure. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1873 ---------------------------------------- http://redmine.ruby-lang.org