1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/irb] Unnamed groups are not captured when named groups are used

https://github.com/ruby/irb/commit/0a641a69b0
This commit is contained in:
Nobuyoshi Nakada 2020-01-30 12:08:37 +09:00 committed by aycabta
parent ba04678c98
commit b08c1bea36

View file

@ -148,7 +148,7 @@ module IRB
select_message(receiver, message, candidates, sep)
end
when /^(?<num>-?(0[dbo])?[0-9_]+(\.[0-9_]+)?(([eE][+-]?[0-9]+)?i?|r)?)(?<sep>\.|::)(?<mes>[^.]*)$/
when /^(?<num>-?(?:0[dbo])?[0-9_]+(?:\.[0-9_]+)?(?:(?:[eE][+-]?[0-9]+)?i?|r)?)(?<sep>\.|::)(?<mes>[^.]*)$/
# Numeric
receiver = $~[:num]
sep = $~[:sep]