Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Regex to add space after punctuation sign

by dda (Friar)
on Jan 10, 2004 at 20:34 UTC ( #320370=note: print w/replies, xml ) Need Help??


in reply to Re: Regex to add space after punctuation sign
in thread Regex to add space after punctuation sign

Hmm.. Just tried:
$_ = "1.2.a.b"; s/(?!\d[.,]\d)([^\w\s])(?!\s)/$1 /g; print;
Prints "1. 2. a. b"

--dda

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://320370]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2016-12-02 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (51 votes). Check out past polls.