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).
Tested with this.s/(?<=\D)([,.]) *(?=\D)/$1 /g;
perl -e '$a="1,23, 23, df,sd.asf,\"\"";$a=~s/(?<=\D)([,.]) *(?=\D)/$1 +/g;print "$a\n";' 1,23, 23, df, sd. asf, ""
|
---|
In Section
Seekers of Perl Wisdom