I have a string that is made up of a list of numbers, seperated by commas. How would I add a space after each comma using Regex?
I find important to note that if the comma is already followed by a space you don't want to add the space:
"1,2, 3,4,5".replace(/,(?=[^\s])/g, ", "); > "1, 2, 3, 4, 5"
This regex checks the following character and only replaces if its no a space character.