Project

General

Profile

Actions

Feature #9253

open

Regexp named match and case statement

Added by oelmekki (Olivier El Mekki) almost 11 years ago. Updated almost 7 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:59139]

Description

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 (?<b>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/

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0