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

instance method Object#!~

self !~ other -> boolRuby 1.9.3 から[permalink][rdoc][edit]

自身が other とマッチしない事を判定します。

self#=~(obj) を反転した結果と同じ結果を返します。

[PARAM] other:
判定するオブジェクトを指定します。
obj = 'regexp'
p (obj !~ /re/) # => false

obj = nil
p (obj !~ /re/) # => true