Improve calculation of current replacement position

'^' or 'no' are supported by this change