このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ

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

instance method Regexp#==

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

otherが同じパターン、オプション、文字コードの正規表現であったらtrueを返します。

[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