
3 Mar
2023
3 Mar
'23
10:55 p.m.
Issue #19476 has been reported by andreccosta (André Costa). ---------------------------------------- Bug #19476: Regexp unexpected match https://bugs.ruby-lang.org/issues/19476 * Author: andreccosta (André Costa) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.1 (2023-02-08 revision 31819e82c8) [arm64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Ruby 3.2.1: ```ruby
RUBY_VERSION => "3.2.1" irb(main):011:0> "123456789".match(/(\(?\d-?\)?){6,15}/) => #<MatchData "123456" 1:"6"> irb(main):012:0> "123456789".match(/(\d-?\)?){6,}/) => #<MatchData "123456" 1:"6">
Ruby 3.1.3:
``` ruby
> RUBY_VERSION
=> "3.1.3"
> "123456789".match(/(\(?\d-?\)?){6,15}/)
=> #<MatchData "123456789" 1:"9">
> "123456789".match(/(\d-?\)?){6,}/)
=> #<MatchData "123456789" 1:"9">