I am trying to replace commas bounded by nonwhite space with a white space, while keeping other commas untouched (in R).
Imagine I have:
j<-"Abc,Abc, and c"
and I want:
"Abc Abc, and c"
This almost works:
gsub("[^ ],[^ ]"," " ,j)
But it removes the characters either side of the commas to give:
"Ab bc, and c"
"(?<=\\S),(?=\\S)"
? – Conjuncture