Actions
Bug #19746
closed`String#index` with regexp and too large offset doesn't clear `$~`
Description
/./ =~ "a"
p "x".index(/0/, 4) #=> nil
p $~ #=> #<MatchData "a">
while rindex
does.
/./ =~ "a"
p "x".rindex(/0/, 4) #=> nil
p $~ #=> nil
It seems since 1.9.
Actions
Like1
Like0Like0