From: "oelmekki (Olivier El Mekki)" Date: 2013-12-17T17:42:32+09:00 Subject: [ruby-core:59156] [ruby-trunk - Feature #9253] Regexp named match and case statement Issue #9253 has been updated by oelmekki (Olivier El Mekki). I didn't know of this syntax, thanks Yusuke. mame (Yusuke Endoh) wrote: > There is a way to capture it: use $~[:b] instead of b. Nonetheless, I like this proposal. > > -- > Yusuke Endoh ---------------------------------------- Feature #9253: Regexp named match and case statement https://bugs.ruby-lang.org/issues/9253#change-43719 Author: oelmekki (Olivier El Mekki) Status: Open Priority: Low Assignee: Category: regexp Target version: current: 2.1.0 Hello, I've notice there's no mean to use captured named matches with case statement : > a, b = "foo bar", nil => ["foo bar", nil] > case a > when /foo (?bar)/ then p b > end nil This is not critical, because we can use $1, $2 and friends in place, but it certainly would be nice and less surprising if it worked. NB : btw, the link "How to report" [1] from tracker home page [2] is a 404. [1] https://bugs.ruby-lang.org/projects/ruby/wiki/HowtoReport [2] https://bugs.ruby-lang.org/ -- http://bugs.ruby-lang.org/