Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Regex to add space after punctuation sign

by Hena (Friar)
on Jan 08, 2004 at 09:53 UTC ( #319768=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    s/(?<=\D)([,.]) *(?=\D)/$1 /g;
    
  2. or download 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, ""
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://319768]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-07-26 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (179 votes), past polls