From: anamma06@... Date: 2017-12-27T13:17:48+00:00 Subject: [ruby-core:84514] [Ruby trunk Bug#14249] Remove str[match_str] Issue #14249 has been reported by ana06 (Ana Maria Martinez Gomez). ---------------------------------------- Bug #14249: Remove str[match_str] https://bugs.ruby-lang.org/issues/14249 * Author: ana06 (Ana Maria Martinez Gomez) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.4 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- I wonder if `str[match_str]` makes sense. ``` Ruby "ana"['a'] => "a" ``` I would say this is not expected and it brings problems, for example when accessing nested hashes. For example: ``` Ruby params = { "user" => "Nicolas Cage" } => {"user"=>"Nicolas Cage"} params["user"]["age"] => "age" ``` I think `str[regexp]` is enough and that `str[match_str]` can be removed. -- https://bugs.ruby-lang.org/ Unsubscribe: