
Issue #19591 has been reported by palkan (Vladimir Dementyev). ---------------------------------------- Feature #19591: Add symbolize_keys to MatchData#named_captures https://bugs.ruby-lang.org/issues/19591 * Author: palkan (Vladimir Dementyev) * Status: Open * Priority: Normal ---------------------------------------- This feature is a follow-up for MatchData#deconstruct_keys (see https://github.com/ruby/ruby/pull/6216). Example: ```ruby m = /(?<a>.)(?<a>.)/.match("01") # => #<MatchData "01" a:"0" a:"1"> m.named_captures #=> {"a" => "1"} m.named_captures(symbolize_keys: true) #=> {:a => "1"} ``` The underlying (C) functionality has been already implemented. The proposal is to expose it via the optional `symbolize_keys: true | false` keyword argument. PR is attached: https://github.com/ruby/ruby/pull/6952 -- https://bugs.ruby-lang.org/