Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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


Comment on Re: Re: Regex to add space after punctuation sign
Select or Download Code

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 pondering the Monastery: (12)
As of 2015-07-31 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls