Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: The craziest RegExes you ever created

by GrandFather (Sage)
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
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 romping around the Monastery: (4)
As of 2020-11-24 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?