From: shyouhei@... Date: 2017-07-25T00:28:01+00:00 Subject: [ruby-core:82157] [Ruby trunk Bug#13716][Open] Unexpected or undocumented (or maybe both) behaviour when mixing String#scan with named captures Issue #13716 has been updated by shyouhei (Shyouhei Urabe). Status changed from Feedback to Open akr (Akira Tanaka) wrote: > When you use a named capture, parenthesises are not considered as a capture. Where can I learn that restriction? I have never heard of such thing before. ---------------------------------------- Bug #13716: Unexpected or undocumented (or maybe both) behaviour when mixing String#scan with named captures https://bugs.ruby-lang.org/issues/13716#change-65911 * Author: shyouhei (Shyouhei Urabe) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.0dev (2017-06-22 trunk 59146) [x86_64-darwin15] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- Is this intentional? ``` [1] pry(main)> "1q2w3e4r".scan(/(\w\d)(foo){0}/) => [["q2", nil], ["w3", nil], ["e4", nil]] [2] pry(main)> "1q2w3e4r".scan(/(\w\d)(?foo){0}/) => [[nil], [nil], [nil]] ``` The only difference is the capture being named. -- https://bugs.ruby-lang.org/ Unsubscribe: