According to the 1.8.5 core API:
str =~ obj => fixnum or nil
Match. If obj is a Regexp, use it as a pattern to match against str. If
obj is a String, look for it in str (similar to String#index). Returns
the position the match starts, or nil if there is no match.
So I expect “cat” =~ “a” #=> 1
irb(main):014:0> “cat” =~ “a”
TypeError: type mismatch: String given
from (irb):14:in `=~’
An undocumented change? Sorry if this has come up before, I did try to
find out. Thx - m.