Video Presentation: Regular Expressions, Extraordinary Power

Posted March 11, 2011 at 9:23 AM by Ben Nadel

Tags: ColdFusion

I first learned how to use Regular Expressions (aka RegEx) about 6 or 7 years ago for the purposes of data cleaning. I would take massive Excel files, paste them into Macromedia Homesite, and then use the Find/Replace feature to strip out all the extra spaces, tabs, and commas. It was tedious work; but, I am tremendously thankful that I had to do it because learning Regular Expressions has more than paid for itself in terms of programming efficiency.

Frankly, Regular Expressions are amazing! They're almost magical. But, they are complex, which is why so many developers shy away from them. In this video presentation, I do my best to try and break down Regular Expressions into tiny, bite-sized components that you can much more easily wrap your head around. And, hopefully, by the end, you can start to see the kind of potential that Regular Expressions provide.

 
 
 
 
 
 
Video Presentation: Regular Expressions, Extraordinary Power - an introduction to regular expressions in programming. 
 
 
 

To watch the video presentation, click here. If you don't want to sit through whole video, which is about an hour long, click here to view the slides directly.

And, don't forget! International Regular Expression Day is June 1st! It's the 4th annual day of celebration in praise of powerful string manipulation! We'll be giving out fun prizes and just reveling in the awesome glow of Regular Expression goodness.

 
 
 
 
 
 
International Regular Expression Day 2011 - June 1st, 2011. A celebration of powerful string manipulation! 
 
 
 

Stay tuned for more information on Regular Expression Day.




Reader Comments

Mar 11, 2011 at 10:07 AM // reply »
148 Comments

There is such a day? I guess I have 2 1/2 month to practice my regex skills before then . . .


Mar 11, 2011 at 10:13 AM // reply »
5 Comments

Ben

First things first,
Ben Nadel is Awesome.

I have always been a bit wary and confused by the power and complexity of regular expressions.
Being at your talk at SOTR2011 - in typical fashion you broke it down into simple concepts and very quickly had me understanding it a lot better and in much greater depth.

Thanks for posting the slides and video!

Cheers
Marty


Mar 11, 2011 at 10:22 AM // reply »
11,314 Comments

@Lola,

Heck yeah there is :D

@Martin,

Thanks a lot - it's really nice to hear that this stuff came out a bit less intimidating than it might normally. The basic building blocks of regular expressions aren't too bad; it's that the combination of those building blocks can quickly get quite complex!


Jon
Mar 11, 2011 at 12:45 PM // reply »
7 Comments

I liked the way you broke down the string and formed the regular expression. It made it easy to follow.


Mar 11, 2011 at 1:05 PM // reply »
11,314 Comments

@Jon,

Thanks! I was hoping the step-wise approach would help clarify some stuff.


Mar 11, 2011 at 2:08 PM // reply »
74 Comments

There is definitely some point when working with REGEX that it clicks. If you don't get to that point, then you are perpetually stuck trying to avoid them or mashing keys in a regex tester until it works but you don't know why (I've spent hours with yours, Ben).

I imagine many people are in that position above when it comes to hobbyist or part-time programmers. For me, it clicked when tackling a really complex reg-ex. I had to use so many expressions, that I had to actually analyze the problem and solution more thoroughly than ever before. In fact, the regex testers were probably a handicap that prolonged my regex avoidance.

I would also like to request more pictures in celebration of regex day. I have no specific requests, but we should have something to celebrate, right?


Mar 11, 2011 at 2:29 PM // reply »
11,314 Comments

@Justin,

I completely agree - this kind of stuff doesn't really click until you try it out in the field, so to speak. And even then, there's stuff that is just always complex. I've been loving RegEx for years and I still get tripped up and things don't work like I expect them to.

Pictures... I'll see what I can do :)


Mar 11, 2011 at 4:45 PM // reply »
28 Comments

Great presentation @ NYCFUG, Ben. You really helped fill in some of the missing pieces for me.

And, today, I used what I learned to debug some htaccess rules that were giving me problems!


Mar 11, 2011 at 4:51 PM // reply »
11,314 Comments

@Aaron,

Thanks my man! HTAccess stuff can be such a pain to debug! URL rewriting stuff in general is a pain because seeing where things are going wrong is never easy with CFDump :D


Mar 16, 2011 at 11:49 AM // reply »
5 Comments

Thanks for a great presentation, Ben! I enjoyed it and it really took some of the mystique out of RegEx.


Mar 16, 2011 at 11:55 AM // reply »
11,314 Comments

@Candace,

My pleasure! It was also good running into you at the NYC UPA last night. Those presentations are so cool.


Mar 16, 2011 at 12:45 PM // reply »
5 Comments

@Ben, I am somewhat of a UX fresk, but I don't get to use it much currently :(

So, I entertain and educate myself at the meetups, etc.

And it was GREAT to see you an Clark's familiar, lovely faces. :D


Mar 16, 2011 at 12:48 PM // reply »
11,314 Comments

@Candace,

Ha ha, thanks :) I'm trying to get much more into UX which is interesting, trying to constantly not worry about code, just about experience. I'm sure I'll see you more meetings then.


Apr 1, 2011 at 1:27 PM // reply »
2 Comments

Awesome presentation. However I have a request for the HTML presentation. Could you possibly have "Next" and "Prev" buttons for navigation instead of clicking anywhere? One, because when I select some text to copy it, it goes to the next slide. And two, it would be easier to go backward instead of adjusting the url. Thanks!


Apr 1, 2011 at 1:33 PM // reply »
11,314 Comments

@WinterJunkie,

You can use the left/right arrows to help you navigate between the slides. But, I agree on the copy-paste stuff. I have also felt that problem with my own slides :(


Apr 1, 2011 at 1:45 PM // reply »
2 Comments

Doh! That makes perfect sense.


Apr 1, 2011 at 5:06 PM // reply »
11,314 Comments

@WinterJunkie,

Even with the left/right, you are still correct - you can't copy and paste (at least not easily without losing the current slide). It is an experience that could easily be improved.


Feb 28, 2012 at 11:33 PM // reply »
6 Comments

Hi Ben.

Hey, just wanted to say thanks for this video tutorial. It really helped me create some regex solutions for front-end data validation.

Keep up the good work.

Chris


May 30, 2013 at 3:32 PM // reply »
2 Comments

Ben:

Thanks for taking the time to make this video and post it for all to see.

I've been around pattern matching for a long time, mostly using OmniMark. I've only used RegEx when working in ColdFusion and then just scratching the surface of it. I was surprised that RegEx has a look ahead function, something I used a lot in OmniMark.

Also, I appreciated your off-topic comments and felt the compassion in your voice regarding making it comfortable for users. In the old days, it seemed like programmers were often lazy and would not go the extra mile to make things easier for users. I hope that has changed.

Tanks again!



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
Jun 19, 2013 at 11:31 PM
Directive Link, $observe, And $watch Functions Execute Inside An AngularJS Context
@Ben, bunch to learn indeed, but thats fun part : ) ... read »
Jun 19, 2013 at 10:41 PM
Referencing ColdFusion Query Columns In A Loop Using Both Array And Dot Notation
Burdock-roots Are you going fat day by day? You need to be good for your family and make some money too. So we bring for you a best product that helps you to be more energetic every day. You will b ... read »
Jun 19, 2013 at 9:52 PM
Working With Inherited Collections In AngularJS
I recognize the applicability of your solution, and how easy it makes to share data across multiple views or even "submodules" of rather simple application. But it seems to me that it creat ... read »
Jun 19, 2013 at 9:38 PM
Directive Link, $observe, And $watch Functions Execute Inside An AngularJS Context
@Alesei, Glad you like it. Even after working with AngularJS for months, I still get a bunch of unexpected, "$digest is already in progress". So hard to debug sometimes! ... read »
Jun 19, 2013 at 9:36 PM
Working With Inherited Collections In AngularJS
@Mike, The relationship of $scope values is definitely an interesting thing! But it's not simple - it really forces you to understand prototypal inheritance, which is not at all a simple topic! Gla ... read »
Jun 19, 2013 at 9:35 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
@Joe, Oh, super interesting! I had only thought to url-encode the signature; but I think that's because the S3 docs actually have a special NOTE telling you to do so. It would have never occurred t ... read »
Jun 19, 2013 at 9:32 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
@Richard, Glad you like! Hopefully I'll have some more interesting stuff coming. This morning, I blogged a bit more about generating the pre-signed, query string authenticated URLs; but, then deeme ... read »
Jun 19, 2013 at 9:31 PM
Filter vs. ngHide With ngRepeat In AngularJS
@Mike, Honestly, in the majority of cases, I would say there isn't going to be a difference. Both approaches have trade-offs. If you use the filter, then you have fewer DOM elements and fewer $scop ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools