Quote all \ and ", not just the first

Use 'g' flag for replace() regex.