Replace the string correctly by using lookahead assretion