str = "beginabc noreplacefgd end"
temp = mid(str, 6, len(str) - 8)
if instr(temp, "noreplace") then
else
   str = "begin" & "xyz" & "end"
end if