The second sentence below makes sense, but I'm not sure the sentence above does - possibly should just delete the tail end and combine them.

with the source string with the <delete> search string characters replaced by...