Implement s///g correctly when replacement string is a different
length that the matched string.