Skip to main content
Ben Nadel at CFCamp 2023 (Freising, Germany) with: Claudio Andreas Rüger
Ben Nadel at CFCamp 2023 (Freising, Germany) with: Claudio Andreas Rüger

Video Presentation: Regular Expressions, Extraordinary Power

By
Published in Comments (19)

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.

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.

Stay tuned for more information on Regular Expression Day.

Reader Comments

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

15,841 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!

7 Comments

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

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?

15,841 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 :)

29 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!

15,841 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

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

15,841 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.

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!

15,841 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 :(

15,841 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.

9 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

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!

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel