diff --git a/re.c b/re.c index 352e5f0c73..f3be9a1fce 100644 --- a/re.c +++ b/re.c @@ -2151,6 +2151,17 @@ match_ary_aref(VALUE match, VALUE idx, VALUE result) * m['foo'] # => "h" * m[:bar] # => "ge" * + * If multiple captures have the same name, returns the last matched + * substring. + * + * m = /(?.)(?.+)/.match("hoge") + * # => # + * m[:foo] #=> "oge" + * + * m = /\W(?.+)|\w(?.+)|(?.+)/.match("hoge") + * # + * m[:foo] #=> "oge" + * */ static VALUE