If you want to be really clever, `gsub(/(\s)\s+/, '\\1')` preserves the whitespace used.