Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Regex Fridge Code

by darksym (Beadle)
on Apr 17, 2002 at 08:23 UTC ( #159747=perlmeditation: print w/replies, xml ) Need Help??

In a bout of severe head trauma induced by lack of sleep and large doses of caffeine, I took a whole new approach to regexing -- fridge code regexing (pp.) as a recursive definition:

regexfun.gif (149K) (Animated GIF, sorry PNG's don't have animation.) Designed in GIMP.

Please don't hold the useless use of .* ^ and $ against me, I had to include them somewhere!

--
<xmp> <mcm> you have too much free time...
<me> umm... it just occured to me that I meant "intelligible"
<me> mcm: hehe, I do?
<me> I was thinking that exact thing when I was doing that
<-- Evanidus has quit ("brb")
<me> I was like "I bet some one is going to say 'You have too much free time on your hands'."
<mcm> hehe...
<me> no, I'm just temporarily insomniac...

Replies are listed 'Best First'.
Re: Regex Fridge Code
by darksym (Beadle) on Apr 18, 2002 at 02:00 UTC
    Hehe, strange isn't it? Perhaps I have some explaining to do...
    =)

    The original plan was to show an animated GIF of a regex matching as an instructional aid, but I decided to do something more abstract (and less practical) because... ... umm... Yeah.

    You'll notice there are hidden messages such as:
    - regex Pr\n. (noun) - regex pr0n? How lewd!
    - pm, pl (as in Perl)
    - ... (fill in the rest, hint: what OS do you (have to) love?)
    So just incase you thought you were being brainwashed, you are. Thank the political adverts for this idea. :) heh-heh-heh, "Excellennnttt... it's only a matter of time now." <evil laughter>

    This regex should parse/match most variants of the word 'regex' including:
    - regex - \n.\ (root word), defined here.
    - regexes, regexen - \n. pl.\ "I have two very readable regexen."; "Perlmonks saint: I thought regexes where suppose to be hard!"
    - regexens - \n. pl.\ slang, regexen variant.
    - regex - \v. present tense\
    - regexes - \v. present participle third person\ - "He who regexes..."
    - regexer - \n.\ One who regexes.
    - regexers - \n. pl.\ - "Perl users become avid regexers as they find how it really improves the readability of their code."
    - regexed - \v. past tense\ - "I have regexed for the good of the country."
    Special cases:
    - regexing ($3) - \v. pp.\ - "Regexing for the benefit of newbies."
    - regexp ($1) - \n.\ Evil black sheep form, that _LOTS of people STILL use_ damnit. (Peer pressure persuades us from using this form.)

Re: Regex Fridge Code
by Popcorn Dave (Abbot) on Apr 17, 2002 at 20:10 UTC
    Brought a much needed smile to my face today after looking at my code... lol

    Good work!

Re: Regex Fridge Code
by RMGir (Prior) on Apr 17, 2002 at 13:08 UTC
    LOL, you DO have too much time on your hands :)

    ++, though, it's very nice work!

    /me sets GIF animations back to off in his browser...
    --
    Mike

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://159747]
Approved by claree0
Front-paged by lemming
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2021-10-28 17:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (96 votes). Check out past polls.

    Notices?