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
string.c
View on GitHub ↗
static VALUE
sym_match(VALUE sym, VALUE other)
{
return rb_str_match(rb_sym2str(sym), other);
}
Equivalent to self.to_s =~ other, including possible updates to global variables; see String#=~.