Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Symbol#=~

(::Regexp regex) -> ::Integer?
[T] (::String::_MatchAgainst[::String, T] object) -> T
self =~ other → integer or nil

Equivalent to self.to_s =~ other, including possible updates to global variables; see String#=~.

See also #=== #[] #== #capitalize also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0