From: matz@... (Yukihiro Matsumoto) Date: 2003-05-25T08:04:38+09:00 Subject: Re: [Q] Change in 1.8 String#=~ intentional? Hi, In message "[Q] Change in 1.8 String#=~ intentional?" on 03/05/24, "Warren Brown" writes: | In converting some code from Ruby version 1.6.8 to 1.8, I found that the |construct: | |"x" =~ "[x]" | | has apparently changed behavior. In version 1.6.8, String#=~ will |convert a String argument into a Regexp. In version 1.8, apparently this is |now translated into a call to String#index. | Is this change intentional? It would seem that this change would affect |a lot of exsiting code in subtle, hard-to-find ways :o( This is now under discussion in ruby-list. The behavior will be either * use String#index internally, with warning. * give warning to discourage using string as an argument. I will have warning in 1.8.0 anyway for any incompatible changes, at least I'm trying so. matz.