timeout -> Float | nilRuby 3.2 から[permalink][rdoc][edit]() → Float?-
selfのマッチにかける時間の上限を秒数で返します。上限が設定されていない場合は
nilを返します。この設定は正規表現オブジェクトごとのもので、Regexp.new の
timeoutキーワード引数で指定します。設定されている場合、Regexp.timeout によるプロセス全体の設定よりも優先されます。re = Regexp.new("^(a|a)*$", timeout: 0.5) p re.timeout # => 0.5 p /^(a|a)*$/.timeout # => nil[SEE_ALSO] Regexp.timeout, Regexp.timeout=