ruby -e 'p "hello".index(/l/, -3)' # -> nil
ruby -e 'p "hello".index("l", -3)' # -> 2
I suspect string.c:568 should change from
pos = rb_reg_adjust_startpos(sub, str, pos, 0);
to
if (pos < 0)
pos = rb_reg_adjust_startpos(sub, str, -pos, 1);
else
pos = rb_reg_adjust_startpos(sub, str, pos, 0);
but knowing for sure would mean understanding the regexp setup code,
and I only have one life ;-)
Regards
Dave