I trying to replace spaces with comma for words that only have space between them like this example
Color : NavyBlue TrainLength : FloorLength USSize : 6 shipping : standard
it should be like this
Color : NavyBlue,TrainLength : FloorLength,USSize : 6,shipping : standard
where it has commas between these variants
I can only match spaces between words that have colons
\s*:\s*
but I need a way to match spaces between words that has no colon
for example consider the dots as space
don't match this ...:...
but match this NavyBlue.....TrainLength
match the spaces only not the words
to test it test real example
.replace(/([a-z0-9]) ([a-z0-9])/gi, "$1,$2");