in reply to Code Misses a Replacement

Can't tell for sure without verbatim of output, but since there appears to be a \s in the output in the spot where the third from last comma was in the original, suspect the issue is appearance, ONLY. Look at the output with an editor (hex, whatever) that lets you see the actual bytes...

A tab can appear to be a single space, depending on its location, tabwidth, etc.