Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Regex to add space after punctuation sign

by ysth (Canon)
on Jan 08, 2004 at 09:19 UTC ( #319757=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $s =~ s/(?<=(?<!\d(?=[.,]\d))\p{P})(?!\s)/ /g;
    
  2. or download this
    $ perl -wle'use charnames (); for (0..255) { chr($_) =~ /\pP/ and prin
    +t chr($_)
    ," ($_): ", charnames::viacode($_) }'
    ...
     (183): MIDDLE DOT
     (187): RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
     (191): INVERTED QUESTION MARK
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2016-02-10 18:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (354 votes), past polls