From: Pistos Christou Date: 2006-03-30T01:40:40+09:00 Subject: Re: Regexp gotcha Robert Dober wrote: > class String > alias_method :__old_match, :=~ > def =~(obj) > raise RuntimeError, > "#{obj.nil? ? "nil" : obj.to_s} is not a Regexp but #{ > obj.class}" unless Regexp === obj > __old_match obj > end # def =~(obj) > end # class String Thanks for the suggestion, Robert. While I have no qualms about extending core classes, this sort of adjustment feels like too... "brash"? of a modification for me. :) In this particular case, rewriting my if line is an acceptable solution to the problem. Pistos -- Posted via http://www.ruby-forum.com/.