I Won Steven Levithan's Regular Expression Contest!

Posted July 9, 2008 at 9:20 AM by Ben Nadel

Tags: ColdFusion

I know this is way late (still trying to catch up on my backlog of to-do items post-CFUNITED), but I am pretty exciting about winning Steven Levithan's Regular Expression contest. I submitted an XML document parser that parses the given XML file using a file input stream rather than an entire file read. It was meant to act in the same way that the SAX XML parser works (as an experiment, not as a replacement).

Thanks to Steven Levithan for putting on the contest and for being as big a proponent of regular expressions as I am!




Reader Comments

Jul 9, 2008 at 10:03 AM // reply »
26 Comments

Congrats!


Jul 9, 2008 at 5:14 PM // reply »
66 Comments

Nice job, Ben!

For those of you who aren't aware of it, I was the inadvertent inspiration for Ben being the Master of Regexes that he is. You see...

One day I was "concentrating" on a hard problem -- the kind of hard problem that entire think tanks work on. You know: really hard.

Anyway, while I was deep in thought, I may have inadvertently slumped over onto my keyboard. Certainly, when Ben came in the room, this was the impression he must have had.

"Are you all right, Hal?" Ben asked.

"Hmm...What...Where am...Oh, Ben. Um, yes, of course. I was just working out the algorithm I'll need for this project." I then got up to splash my face with cold water and get some coffee. When I came back, Ben was staring at my screen.

"What is it, Ben?" I asked.

"It looks like you fell asleep. There's a bunch of random letters and characters on the screen," he said.

"Why, err...nonsense! Don't you know a regex when you see one?"

That began Ben's journey into regex mastery. The rest is history.

Oh, and the strange characters that started this off? Once Ben translated it, it turned out to be a remarkably clever proof of an algorithm for which I was nominated for a Nobel Prize in Programming.

But enough about me. Congrats, Ben.


Jul 9, 2008 at 6:00 PM // reply »
11,238 Comments

I would not have believed it if I were not there :) Had Hal's face not gotten all friendly with that keyboard, I dare not think where I would be today.


Jul 9, 2008 at 7:00 PM // reply »
9 Comments

its just amazing how tings work out out sometime, congrats Ben for your award any chance you plan on adding to the XML parsar ceated?


Jul 9, 2008 at 10:05 PM // reply »
2 Comments

Congrats Ben! :)

Goonie


Jul 10, 2008 at 2:31 PM // reply »
149 Comments

Props on owning that c-test.

While we're on the subject, for the developers that have perpetually re-queued "Learn regular expressions" to the bottom of their study queue, where would you recommend we start to become as expert and REGEX savvy as possible with as little an investment of time as possible (ideally about 3-4 minutes total) ?

Where did you start? What helped you the most (besides being a genius)?
Thanks!


Jul 10, 2008 at 3:02 PM // reply »
11,238 Comments

@David,

Here is a post that has a great tutorial:

http://www.bennadel.com/index.cfm?dax=blog:507.view

.. and here is a tutorial that I wrote for my developers when I was at Nylon Technology:

http://www.bennadel.com/index.cfm?dax=blog:458.view

Just start out with simple ones and go from there. And the key that I always try to get across to people - don't worry about reading regular expression; they are very hard to read. Just worry about writing them.

Good luck!


Sep 4, 2009 at 1:28 PM // reply »
1 Comments

Hi,

Do you know of any tools/code that will read through a set of values and generate regular expressions? Thanks for any info.

I need some way to automatically score consistency across a set of database field values.

BH


Sep 6, 2009 at 10:41 AM // reply »
11,238 Comments

@Brian,

Can you explain a little bit more about what you mean? I am not sure that I fully understand what you are trying to do?


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 21, 2013 at 7:46 PM
Using Plupload For Drag & Drop File Uploads In ColdFusion
No luck. At least I have uncovered the cause, URLScan 3.1. Here is what I see in the IIS log when a file is over 30mb. 2013-05-21 23:29:05 10.105.45.128 GET /plupload/assets/jquery/jquery-1.8. ... read »
May 21, 2013 at 6:12 PM
Using Plupload For Drag & Drop File Uploads In ColdFusion
Ben, I did not see you after Pete Freitag's Lockdown session at cfObjective but he said that IIS sets file size limits at 30MB by default which just happened to be the threshold for file size when ... read »
May 21, 2013 at 11:51 AM
Ask Ben: Parsing Very Large XML Documents In ColdFusion
Looking at my first ever XML document that I have to parse and put into MS SQL 2000 with CF8. I get it to list the desired Field name, many times over, and have a long list of this field name displa ... read »
May 21, 2013 at 9:25 AM
Turning Off and On Identity Column in SQL Server
you are awesome..i am lucky to get this blog between such a garbage one....Thanks, Prashant ... read »
May 20, 2013 at 4:38 PM
Using A Dynamic Column Name With ValueList() In ColdFusion
@Dana, Your confusion is well founded, since this is a very confusing features. In fact, it ONLY works if you use array notation. Meaning, that this: arrayToList( query[ "columnName" ] ) ... read »
May 20, 2013 at 4:34 PM
Using A Dynamic Column Name With ValueList() In ColdFusion
I was thinking chicken and the egg, I wouldn't have expected it to work in the valuelist going in I guess. Maybe I just need a beer, long day :) ... read »
May 20, 2013 at 4:29 PM
Using A Dynamic Column Name With ValueList() In ColdFusion
@Dana, That's if you're trying to reference a specific row. In this case, we're trying to reference the entire query column as one cohesive value. So, you are correct that if you wanted to output a ... read »
May 20, 2013 at 4:24 PM
Using A Dynamic Column Name With ValueList() In ColdFusion
I thought when you used array notation to reference queries you always had to have the row or it would throw a similar error as well? ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools