Project

General

Profile

Actions

Feature #1873

closed

MatchData#[]: Omits All But Last Captures Corresponding to the Same Named Group

Added by runpaint (Run Paint Run Run) over 15 years ago. Updated about 7 years ago.

Status:
Rejected
Target version:
[ruby-core:24732]

Description

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

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


Files

re_named_values_at.patch.gz (1015 Bytes) re_named_values_at.patch.gz erikh (Erik Hollensbe), 08/16/2009 11:12 PM
re_all_values.patch.gz (1.39 KB) re_all_values.patch.gz erikh (Erik Hollensbe), 04/11/2012 06:34 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0