Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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

  • Comment on Re: Regex to add space after punctuation sign

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2016-10-21 20:55 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (290 votes). Check out past polls.