3rd Annual (Inter)?National Regular Expression Day (And Prizes) - June 1st, 2010

Posted May 16, 2010 at 12:53 PM by Ben Nadel

Tags: ColdFusion, Javascript / DHTML

Well, it's almost that time again; June 1st, 2010 will be the 3rd annual (Inter)?National Regular Expression Day - a celebration of powerful string manipulation! Typically, this day kind of sneaks up on me, so this year I wanted to try and make a bigger todo of it. Regular Expressions are special strings that represent patterns of character data. They can be used to search, replace, and validate text content and happen to be one of the most powerful tools in the developer's toolbox. If you are not familiar with regular expressions, I recommend taking a look at my Intro to Regular Expressions blog post.

This year, I got two companies to sponsor Regular Expression Day: O'Reilly and Micronovae. O'Reilly was nice enough to send along several copies of their regular expression books:

 
 
 
 
 
 
Regular Expression Day 2010 Prizes - O'Reilly Books On Regular Expressions. 
 
 
 

While I haven't read Mastering Regular Expressions, I have read the Regular Expression Cookbook and I have to say that it is simply phenomenal. It was co-authored by Steven Levithan and Jan Goyvaerts. I don't know too much about Jan, but from personal experience, I can tell you that Steven Levithan is a regex genius who has many times sprinkled his pattern-matching expertise over the algorithms presented on this blog.

Micronovae has donated twelve IIS Mod-Rewrite Pro licenses ($150 value per license):

 
 
 
 
 
 
Regular Expression Day 2010 Prizes - Micronovae Giving Out IIS MOD-Rewrite Pro Licenses. 
 
 
 

IIS Mod-Rewrite is a powerful, high quality professional URL rewriting tool for IIS. It rewrites URLs on the fly by using flexible custom rules and helps web developers and webmasters get the most out of their web applications. It is ideal for Search Engine Optimization (SEO), redirecting or proxying requests, blocking undesired traffic and much more. The Pro version is 100% compatible with Apache's mod_rewrite engine; in fact, I use IIS Mod-Rewrite on our production servers and Apache's mod_rewrite in local development with zero configuration changes between the two - it's pretty amazing!

How To Win Cool Regular Expression Prizes

This year, I tried to come with a fun and goofy way to give out prizes. As a passionate and dedicated programmer, I spend most of my time in front of a computer solving problems and doing research; as such, I never got too good at talking to the "ladies." So this year, I built a regular-expression-powered Girl Simulator that will allow me to practice my "moves" from behind the safety and comfort of a computer monitor.

 
 
 
 
 
 
 
 
 
 

To enter for a chance to win prizes, you have to add rules to the regular expression engine that powers the Girl Simulator below. Each rule consists of a single pattern and up to three responses. If the given pattern matches an incoming comment (from me), one of the defined responses will be chosen at random and returned. On June 1st, I'll give out prizes based on randomly selected rules in the pattern-matching engine.

 
 
 
 
 
 
 
 
 
 



Reader Comments

May 16, 2010 at 1:48 PM // reply »
33 Comments

Does it support subpattern matching in the reponce, ie can I use \1 \2 \3, etc?


May 16, 2010 at 1:49 PM // reply »
33 Comments

Darn, guess not


May 16, 2010 at 1:51 PM // reply »
11,238 Comments

@David,

I didn't even think of that! Right now, it just uses the Java pattern matching engine to see if the match can be found. I'll see if perhaps I can get some more complex logic in there.


May 16, 2010 at 5:04 PM // reply »
2 Comments

Ben, this is the coolest thing ever.. awesome work!


May 16, 2010 at 5:12 PM // reply »
11,238 Comments

@Matt,

Thanks my man :) Glad you like. Feel free to spread the word.


May 17, 2010 at 6:16 AM // reply »
14 Comments

Ha ha, that's a really good one Ben. I've added some entries.


May 17, 2010 at 8:04 AM // reply »
19 Comments

ironically, although I'm rubbish at regular expressions, when it comes to the ladeez...also rubbish.


May 17, 2010 at 9:11 AM // reply »
11,238 Comments

@Darren,

Ha ha, so this will be good practice on both fronts ;)


May 18, 2010 at 12:38 PM // reply »
2 Comments

Really funny reg-exp logic Girl!

thanks by the funny time.

:-)


May 18, 2010 at 8:27 PM // reply »
11,238 Comments

@All,

FYI, Micronovae has donated 10 *additional* PRO licences for the contest. I will not be giving away 12. Sweeeet!


May 20, 2010 at 9:48 PM // reply »
57 Comments

Hhm, this seems just *wrong* to me! I'm not sure I want to give away the secrets of what women are really thinking. ;-)

Seriously though Ben, you didn't include subpatterns for the responses?? What were you thinking man?!


May 20, 2010 at 9:55 PM // reply »
11,238 Comments

@Mary,

Help a guy out :)

The sub-pattern replacement would have been cool. I hadn't even considered it when writing the code. The testing and the replace are done in different steps behind the scenes, so it's not even an easy update to make ... actually... maybe there is something I can do. Of course, the validation becomes more complicated as well. Hmmmm.


May 20, 2010 at 10:15 PM // reply »
57 Comments

@Ben - Just read that last comment - so what exactly *are* you doing with all those licenses?? Hoarding them for yourself??? (typos are so fun!)


May 20, 2010 at 10:23 PM // reply »
11,238 Comments

@Mary,

Oops :) I thought you were referring to the "12" as being a typo. Just re-read it - makes me seem like some sort of sinister criminal... mwwaaha ha ha ha ha!


May 20, 2010 at 10:27 PM // reply »
57 Comments

@Ben - Oh, it's not that big a deal. I was just adding my Trek captain matcher and had some thoughts for replies with the names that would be cute, but it's not like this is mission critical stuff. ;-)


May 20, 2010 at 10:32 PM // reply »
57 Comments

@Ben - yeah, when I first read that, I was like, huh?? He's not giving them away?? I always seem to catch those typos (I often proofread stuff for friends as I catch everything!)

FYI - My name is Mary Jo, not Mary. Many women have two-word first names...and nothing bugs us more than someone leaving off half of it! ;-) I'm assuming you didn't think "Jo" was my last name....


May 21, 2010 at 3:20 AM // reply »
14 Comments

Haha, can't belive you could come up with such an idea Ben! Very...crazy :-P

My reg exp is not very good though. But even before thinking of reg exp, might have to go back and read books about "talking to the ladies" first ;-)

BTW, the O'Reilly books look very compelling to me, thinking of grabbing a copy of them soon.


May 21, 2010 at 7:28 AM // reply »
57 Comments

@Khoa, What I like about the way Ben designed this is that it totally allows the user to work at whatever level of expertise they have. It doesn't at all require more than a very basic level of regex understanding to come up with some entries.

Knowing how to talk to ladies....that may require a tad more expertise. ;-)


May 21, 2010 at 9:53 AM // reply »
11,238 Comments

@Mary Jo,

If you hit the "Reply" link next to people's names, it auto-fills in the comment box with an "@" style notation; it does this by grabbing the first word - I must have just hit that and forgot to add the "Jo". You and I have had enough emails back and forth for me to know your name ;)


May 21, 2010 at 10:56 AM // reply »
57 Comments

@Ben - Ah, good to know. Yeah, the tech world in particular is not well designed for us two-name folks. I've often run into systems that just absolutely would not accept a first name with spaces in it at all and just ended up writing my name as "MaryJo" to get past that.

Something to think about when writing a regex to parse a name... it's not as easy as it might seem. Then there are the cultures where first and last names are reversed from what we use to make life even more difficult. ;-)


May 21, 2010 at 11:23 AM // reply »
14 Comments

Just to join the "name conversation", my first name is in fact 2 words as well. They are "Vinh Khoa". My last name is Nguyen but I usually just use Vinh Khoa as I prefer to keep it short. Many people don't know that and they just call me Vinh as they think that is my first name :-(

Although I sort of get used to that, Vinh Khoa still sounds a lot nicer to hear when people do know that :-)


May 24, 2010 at 5:51 PM // reply »
13 Comments

My patterns give guys some chances :)
...to encourage optimism in geek lines, whose moral is mowed by the blade of frequent rejection :)))


May 28, 2010 at 11:44 AM // reply »
57 Comments

@Marko - I really chuckled at that note, it's too easy to fall into the pattern of just beating down geeks. Funny, you'd think it might be easier for us geek grrls but I seem to run into as many guys that are not interested in someone with a decent amount of intelligence (or perhaps it's just that I am more than willing to give my opinion and tell them how *wrong* they are on most topics, ha!) as I do those that are fascinated that a girl could know more Star Trek trivia than they do!

@Ben - now that I know the problem with my name pre-filling I can just use the alternate that lots of my family and friends call me by. Makes life easier and I don't have to feel like a twit for correcting anyone on it. ;-)


May 28, 2010 at 12:11 PM // reply »
33 Comments

MJ: You know more star trek trivia then me? That is either incredibly presumptuous or incredibly hot, or both.


May 28, 2010 at 12:24 PM // reply »
57 Comments

@David - well I can't make comparisons that specific, just talking in general. I would *never* presume to impugn a Trekkie's level of trivia knowledge. ;-)


Jun 1, 2010 at 12:23 PM // reply »
1 Comments

This one:

(will|would|want)?.*?(out with me)?

is a bit of a show stopper, maybe take out the optionals from the keywords. Too greedy. :)

Tried to build up a "trap" conversation, but either I made a mistake or the RE above cuts me off.

Anyway, such a lovely idea. Funny too.


Jun 1, 2010 at 2:21 PM // reply »
11,238 Comments

@Groniwug,

Yeah, some of them are a bit greedy in how they match. It's all in good fun, though :)


Jun 2, 2010 at 8:52 AM // reply »
1 Comments

Ben, so how'd it go improvin your skills with the ladies? Regex girl help you along?


Jun 2, 2010 at 8:55 AM // reply »
11,238 Comments

@Ryan,

I only got slapped 3 times yesterday - so, definite improvement!!!


Jun 2, 2010 at 9:54 AM // reply »
11,238 Comments

What a terrific Regular Expression day! I appreciate all the participation. I have taken the rules and passed them through a random selector to get the following winning patterns.

(?im)(what|are you)?\s?(do you)?\s?(do|doing|free)?\s*(tonight|today|tonite)

(D|d)o you (like|want) this (site|website)?

Nice (eyes|hair|shirt|ears|necklace|pigtails)

.*?(apple|mac)+.*?

have.+?((hot|gorgeous|pretty))?(younger|older) (sister|sisters)

.*[Bb]en [Nn]adal.*

(you|You)('re)?.*(very|really)*.*(pretty|beautiful|(drop.dead )?gorgeous|radiant|fine|hot|smokin(g|\')?)+.*

.*(love|like)+.*(ur|your)+.*(smile|pigtails|eyes)+

Wanna.+?(Dance|Play|Talk).+?

lactat.*

(Wh|wh|D)o.+?(best|better|like|love).+?(Kirk|Picard|Sisko|Janeway)

are.+?(u|you) going to (SOTR|(s|S)cotch (O|o)n the (R|r)ocks|(S|s)cotch)

.*(RegEx|Regular Expressions)+

fuck|cunt|bitch|slut|whore

howdy

.... I'll be sending out an email to see what people want. I only have a few books to give away and a bunch of IIS Mod-Rewrite licenses so I'll just take the email responses as I get them.

Thanks so much to everyone who participated! It was a grand day indeed, worthy of the beauty that is the Regular Expression!


Jun 3, 2010 at 12:37 PM // reply »
57 Comments

Just wanted to say, kudos on running a fantastic contest, it was a lot of fun, and even more so reading through all the entries and figuring out what they were trying to match on. And I'd say that even if I wasn't one of the lucky winners. ;-)


Jun 3, 2010 at 2:05 PM // reply »
13 Comments

I am one the lucky winners and owe gratitude to Ben for organizing so fun event. Thank you.


Jun 3, 2010 at 3:21 PM // reply »
7 Comments

Looking at the expressions/responses was really a blast (except for a few really dark ones) - a great idea!

I think my favorite response was 'I only date Ruby devs'.



Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 19, 2013 at 2:31 PM
My Experience With AngularJS - The Super-heroic JavaScript MVW Framework
It's funny really just how well that image describes the way I would imagine most people that go with angular for some project is. I have had a similar roller-coaster ride with it as well, but not qu ... read »
May 17, 2013 at 7:42 PM
HashKeyCopier - An AngularJS Utility Class For Merging Cached And Live Data
Ben - thanks so much for posting these Angular articles and findings, they've been a huge help towards learning one of the more 'complex' JavaScript frameworks out there (IMO). I have been using Angu ... read »
May 16, 2013 at 5:01 PM
UPDATE: Parsing CSV Data Files In ColdFusion With csvToArray()
Your code was the closest thing I've found to obtaining some direction for converting ISO fields to values that CF can translate properly. Thank you for posting! ... read »
May 15, 2013 at 10:37 PM
Very Simple Pusher And ColdFusion Powered Chat
hi id making plz easy ... read »
May 15, 2013 at 6:07 PM
Making SOAP Web Service Requests With ColdFusion And CFHTTP
Ben, you once again saved my bacon at work. Thank you, thank you, thank you! ... read »
May 15, 2013 at 4:15 PM
What If All User Interface (UI) Data Came In Reports?
@Josh, Thanks! @Ben, I definitely recommend the David West book "Object Thinking" I've been quoting from. It goes deeply into the philosophy and history of OO programming. His breadth ... read »
May 15, 2013 at 11:36 AM
Ask Ben: Print Part Of A Web Page With jQuery
I found this helpfull when you need to keep (refresh) the original parent page after closing the iframe child print dialog (Hoping you're not using a form at this time so it won't submit again): On ... read »
May 14, 2013 at 7:13 PM
What If All User Interface (UI) Data Came In Reports?
@Jonah, If there's any books you'd recommend on the subject of domain modelling, I'd love to hear it. I just downloaded the free PDF of "Domain Driven Design Quickly". Figured I'd give it ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools