Issue #1873 has been updated by Run Paint Run Run.


> Oh sorry, i misunderstood. I think you wanted to access "b" with /(?<a>\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