Forum: Ruby-core [Bug #2943] Regexp Hash Code Changes

Posted by Nathan Weizenbaum (Guest)
on 2010-03-08 01:54
(Received via mailing list)
Bug #2943: Regexp Hash Code Changes
http://redmine.ruby-lang.org/issues/show/2943

Author: Nathan Weizenbaum
Status: Open, Priority: Normal
ruby -v: ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-linux]

When a Regexp containing a sub-section with the case-insensitivity flag 
set is matched against a string, its hash code changes.

re = /(?i:.)/
p re.hash #=> -452142835
"_" =~ re
p re.hash #=> 21933550
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.