Allow starting replacement anywhere in the function