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

Re: Regex to add space after punctuation sign

by BrowserUk (Pope)
on Jan 08, 2004 at 09:39 UTC ( #319762=note: print w/ replies, xml ) Need Help??


in reply to Regex to add space after punctuation sign

I think most of the solutions so far will fail to put a space into 'x34,3b'.

There is also the question of what to do with '2,3,4,5'? Is that '2,3, 4,5' or '2, 3,4, 5' or '2, 3, 4, 5'? All are possible.

It will probably be very hard to use a single regex to do this if non-numeric bits can start and/or end with a digit.

I got close using s///e, but it was very messy.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!


Comment on Re: Regex to add space after punctuation sign

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (17)
As of 2014-10-30 15:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls