Actions
Feature #5484
closedregexp comparison bug
Status:
Closed
Assignee:
-
Target version:
-
Description
Based on ri Regexp.eql?:
Equality---Two regexps are equal if their patterns are identical, they have
the same character set code, and their casefold? values are the same.
/abc/ == /abc/x #=> false
/abc/ == /abc/i #=> false
/abc/ == /abc/n #=> false
/abc/u == /abc/n #=> false
However:
a = Regexp.new("/foo")
=> //foo/
b = //foo/
=> //foo/
a == b
=> false
The only meaningful difference between the two is the exact source:
a.source
=> "/foo"
b.source
=> "\/foo"
But I'd argue that a's source should be normalized to that of b, or vice-versa, since their string representations are identical.
Actions
Like0
Like0Like0Like0