Store index in scanner on regex and result

This removes the need to track the best index elsewhere