Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Regexp.timeout
() -> ::Float?
Regexp.timeout → float or nil
re.c
View on GitHub ↗
static VALUE
rb_reg_s_timeout_get(VALUE dummy)
{
double d = hrtime2double(rb_reg_match_time_limit);
if (d == 0.0) return Qnil;
return DBL2NUM(d);
}
It returns the current default timeout interval for Regexp matching in second. nil means no default timeout configuration.