From: Ryan Davis Date: 2005-02-20T04:32:24+09:00 Subject: bug in IRB with $_ matching a range of regexps > % ruby -v > ruby 1.8.2 (2005-01-29) [powerpc-darwin7.7.0] these work fine in both forms: > % printf "a\nb\nc\nd\n" | ruby -e 'while gets; print if /^b/../^c/; > end' > b > c > % printf "a\nb\nc\nd\n" | ruby -e 'while gets; print if $_ =~ /^b/ .. > $_ =~ /^c/; end' > b > c second form ($_ =~) works fine in IRB: > % irb > irb(main):001:0> while gets; print if $_ =~ /^b/ .. $_ =~ /^c/; end > a > b > b > c > c > d > => nil But the first form does not: > % irb > irb(main):001:0> while gets; print if /^b/../^c/; end > a > a > b > b > c > c > d > d > => nil -- ryand-ruby@zenspider.com - Seattle.rb - http://www.zenspider.com/seattle.rb http://blog.zenspider.com/ - http://rubyforge.org/projects/ruby2c