Project

General

Profile

Actions

Bug #19471

closed

Regexp::compile does not handle :timeout argument

Added by os (Shigeki OHARA) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-freebsd13.1]
[ruby-core:112652]

Description

I think Regexp::compile is just an alias for Regexp::new, so I assume it handles the :timeout argument.
However, Regexp::compile does not seem to handle the :timeout argument properly.

$ irb
irb(main):001:0> RUBY_VERSION
=> "3.2.1"
irb(main):002:0> re_new = Regexp.new('hoge', timeout: 1.0)
=> /hoge/
irb(main):003:0> re_new.timeout
=> 1.0
irb(main):004:0> re_compile = Regexp.compile('hoge', timeout: 1.0)
=> /hoge/i
irb(main):005:0> re_compile.timeout
=> nil
irb(main):006:0>

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0