Bug #2943

Regexp Hash Code Changes

Added by Nathan Weizenbaum almost 2 years ago. Updated 10 months ago.

[ruby-core:28550]
Status:Open Start date:03/08/2010
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
ruby -v:ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-linux]

Description

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

Also available in: Atom PDF