Project

General

Profile

Actions

Bug #20084

closed

Breaking change with Regexp.new on 3.3.0

Added by paddor (Patrik Wenger) 11 months ago. Updated 11 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
[ruby-core:115889]

Description

Regexp.new used to take up to 3 arguments, but now only 1..2 are allowed:

[1] pry(main)> Regexp.new 'abc', 'i', 'n'
ArgumentError: wrong number of arguments (given 3, expected 1..2)
from (pry):1:in `initialize'

On 3.2.2:

[1] pry(main)> Regexp.new 'abc', 'i', 'n'
=> /abc/in

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #18797: Third argument to Regexp.new is a bit brokenClosedjeremyevans0 (Jeremy Evans)Actions
Actions #1

Updated by hsbt (Hiroshi SHIBATA) 11 months ago

  • Related to Bug #18797: Third argument to Regexp.new is a bit broken added

Updated by hsbt (Hiroshi SHIBATA) 11 months ago

  • Status changed from Open to Closed

It's intentional changes. see https://bugs.ruby-lang.org/issues/18797

Updated by nobu (Nobuyoshi Nakada) 11 months ago

I think we needed to add it to Compatibility issues in NEWS.md.

Updated by paddor (Patrik Wenger) 11 months ago

hsbt (Hiroshi SHIBATA) wrote in #note-2:

It's intentional changes. see https://bugs.ruby-lang.org/issues/18797

Thanks.

nobu (Nobuyoshi Nakada) wrote in #note-3:

I think we needed to add it to Compatibility issues in NEWS.md.

Yeah that would be nice.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0