Yukihiro Matsumoto wrote:
> Hi,
> 
> In message "Re: Regexp equality"
>     on Wed, 20 Oct 2004 03:07:28 +0900, Jamis Buck <jgb3 / email.byu.edu> writes:
> 
> |Can anyone else confirm this? Can anyone *explain* it? Or is this a bug?
> 
> Regexp#== compares literal appearance of regex, e.g.
> 
>   \/blah vs /blah
> 
> I consider this as a feature.  I'm open for the discussion (as always).

Is there a way to test regexen for equality based on the strings they 
would match? Perhaps that's too general, since it depends on the strings 
they would be given, but I guess I expected /\/blah/ to be equal to 
%r{/blah}.

I suppose /\/blah/.to_s would equal %r{/blah}.to_s? Would that be a 
better way to compare regexen?

- Jamis

-- 
Jamis Buck
jgb3 / email.byu.edu
http://www.jamisbuck.org/jamis