Matches a string in a regular expression.
'hello' =~ /^h/ # => 0
If there is no match, nil returned. If you pass invalid arguments to it (i.e., the left or right sides are incorrect), it will either throw a TypeError or return false .
ealdent Jun 11 '10 at 20:07 2010-06-11 20:07
source share