http://www.perlmonks.org?node_id=319768


in reply to Regex to add space after punctuation sign

I'm not quite sure got this right but heres my try (both dot and comma is used).
s/(?<=\D)([,.]) *(?=\D)/$1 /g;
Tested with this.
perl -e '$a="1,23, 23, df,sd.asf,\"\"";$a=~s/(?<=\D)([,.]) *(?=\D)/$1 +/g;print "$a\n";' 1,23, 23, df, sd. asf, ""