use carat position on search for finding the substring to replace