Ruby 4.0 リファレンスマニュアル

instance method Regexp#==

self == other -> bool[permalink][rdoc][edit]
eql?(other) -> bool
(untyped other) → bool

selfother と同じパターン、オプション、文字コードの正規表現オブジェクトであったら true を、そうでなければ false を返します。

[PARAM] other:
比較対象の正規表現オブジェクト
p /^eee$/   == /~eee$/x   # => false
p /^eee$/   == /~eee$/i   # => false
p /^eee$/e  == /~eee$/u   # => false
p /^eee$/ == Regexp.new("^eee$") # => true
p /^eee$/.eql?(/^eee$/)          # => true