I Won Steven Levithan's Regular Expression Contest!

Posted July 9, 2008 at 9:20 AM

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!

Post Comment  |  Ask Ben  |  Print Page





Reader Comments

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

Congrats!


Jul 9, 2008 at 5:14 PM // reply »
56 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 »
7,572 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 »
78 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 »
7,572 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 »
7,572 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 Comment  |  Ask Ben

Recent Blog Comments
Mar 21, 2010 at 8:57 PM
The Bourne Ultimatum Starring Matt Damon And Julia Stiles
late to the party, but my observation is this: rewatch carefully for the platonic nature of the relationship between nicki and jason. she never flirts with him. he never comes on to her. they alway ... read »
Mar 21, 2010 at 7:40 PM
Is Simulating User-Input Events With jQuery Ever A Good Idea?
A couple of things. One you embed the initial state of of more-info in the CSS. IMHO, that behavior should be in jQuery: moreInfo.hide(); It shows that the behavior your toggling and closing is mor ... read »
Mar 21, 2010 at 3:59 PM
Exploring ColdFusion Component Runtime Class Properties And Serialization
@Elliott, according to Ben's experiment, serializeJSON() doesn't access the private data by default - it doesn't even access the getHair() method - so trying to clone a Girl.cfc via serializeJSON/des ... read »
Mar 21, 2010 at 3:49 PM
Ask Ben: Javascript String Replace Method
I'm confused a bit by what you are asking, but if had this sentence: The color, red, is in the style statement; style: red;. and wanted to remove all or change all of the commas, colons, and semi-c ... read »
Mar 21, 2010 at 3:13 PM
Ask Ben: Javascript String Replace Method
I am trying to make a java program to count the number of times that these punctuation marks occur in a body of text: , : ; . ! - ' " ? / \ I am using this piece to ferret out the commas: numcommas ... read »
Mar 21, 2010 at 11:13 AM
A New Wrist Pain
@chiropractor suwanee, Spoken like someone trying to sell something. Other than for minor, temporary relief from some back pain, chiropractic treatment is nothing but placebo effect and quackery. ... read »
Mar 21, 2010 at 6:32 AM
ColdFusion CFPOP - My First Look
Apologies... The field name in the db for C. is "BounceCode" It stores the code / message which is returned in the email. Sorry for the confusion. ... read »
Mar 21, 2010 at 6:29 AM
ColdFusion CFPOP - My First Look
@Jose Galdamez, Hi Ben and Jose 1st of all.. big thanks to Jose for his Skype chat a few weeks back. Your time was much appreciated. I have come up with a rather unelegant solution to my problem a ... read »