Actions
Bug #20421
openString#index and String#byteindex don't clear `$~` when offset > size (or bytesize)
Description
When String#index and String#byteindex are called with Regexp and offset they clear $~
(that contains result of the last Regexp matching) when offset < -size. But they don't clear $~
when offset > size what seems inconsistent:
"a".index(/a/)
p $~ # => #<MatchData "a">
string = "blablabla"
string.index(/bla/, string.length + 1)
p $~ # => #<MatchData "a">
Actions
Like0
Like0