From: Leslie Viljoen Date: 2006-05-26T20:41:08+09:00 Subject: Re: String Match method =~ error On 5/26/06, mitchell wrote: > Tim Kuntz wrote: > > The Ruby doc states the following for a String#=~ > > > > "cat o' 9 tails" =~ '\d' #=> nil > > > > When I run what looks like the same command, I get the following error. > > > > irb(main):001:0> "cat o' 9 tails" =~ '\d' > > TypeError: type mismatch: String given > > from (irb):1:in `=~' > > from (irb):1 > > > > I have tried this on a couple of different environments but always > > Ruby 1.8.4. Can anyone provide me with any insight as to why I don't > > get the nil return value? > > > > tim > > "cat o' 9 tails" =~ /\d/ ie. Ruby Doc is wrong?