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

Re: The craziest RegExes you ever created

by GrandFather (Saint)
on Jul 02, 2006 at 20:47 UTC ( #558883=note: print w/replies, xml ) Need Help??


in reply to The craziest RegExes you ever created

I don't know about crazy, but my very first PerlMonks post was a rather neat little regex to wrap text without mangling words:

s/(.{5,12}\s+)/$1\n/g

which generates (given "Check out http://www.perlmonks.org/?node_id=438189 (it has nice line-wrapping snippet)."):

Check out http://www.perlmonks.org/?node_id=438189 (it has nice line-wrapping snippet).

DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2021-10-22 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?