Actions
Bug #13716
closedUnexpected or undocumented (or maybe both) behaviour when mixing String#scan with named captures
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-06-22 trunk 59146) [x86_64-darwin15]
Description
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>foo){0}/)
=> [[nil], [nil], [nil]]
The only difference is the capture being named.
Actions
Like0
Like0Like0Like0