Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2016-08-31 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (426 votes). Check out past polls.