Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: The craziest RegExes you ever created

by GrandFather (Saint)
on Jul 02, 2006 at 20:47 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-03-29 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found