Pittsburgh Tech Fest 2013: my talk "Stop Overusing Regular Expressions!"

At Pittsburgh TechFest 2013 (full report here), I gave a talk for a one-hour time slot before lunch.

This was my first talk at a conference in three years, and only my second at a conference in my life! I feel that I have much improved as a presenter since then.

Here’s how it went.


My presentation was “Stop overusing regular expressions!”

Here is my abstract as submitted to Pittsburgh TechFest:

Regular expressions are very commonly used to process and validate text data. Unfortunately, they suffer from various limitations. I will discuss the limitations and illustrate how using grammars instead can be an improvement. I will make the examples concrete using parsing libraries in a couple of representative languages, although the ideas are language-independent. (I’ll try to squeeze in, say, Ruby, Python, JavaScript, Scala.)

I will emphasize ease of use, since one reason for the overuse of regular expressions is that they are so easy to pull out of one’s toolbox.


Just on Wednesday, I had given a version of this talk at the Pittsburgh Scala meetup, but revised it considerably based on feedback and my own impressions.

Slides and code

The material for the talk as given is at this tag of my GitHub repository.

My master branch of the GitHub repository will always have my latest revisions. I expect continue to add more code in different languages, for example.

Stop overusing regular expressions! from Franklin Chen


I tried to minimize discussion of the final Scala code slide, which in one page creates a full parser for “toy JSON” into a tree of Scala objects, because I intended mainly to give this as proof of concept, not to get into explaining the funny operator overloading that makes the parser so concise, but this seemed to be an issue anyway. I now lean toward thinking that in the future, I need to create a parallel slide that replaces the operators with standard method names instead.

Why did I use Scala for example code anyway? A major reason is that it is indeed very concise, and yet fully statically typed. I could fit all each of my Scala code examples on a single slide. I did that with Ruby also, up to a point. Writing the classes in Ruby (or Python, Java, etc.) would have taken pages of boilerplate, as opposed to using Scala’s case classes. (Of course I wasn’t going to use ML or Haskell at all in the talk for this audience.)

I was surprised to learn how quickly I had finished my presentation (around 45 minutes), given that I had actually added many slides after my Pittsburgh Scala version (which had lasted around the same time). I think it could have been because of the following:


Turnout was small, around eight people, but enthusiastic. Half the people I already knew, but the other half were new to me.

I have some hypotheses about why attendance was relatively low (I think most of the talks I went to had 20-40 people):


Thanks to everyone who came to the talk and asked questions and got discussion going! I appreciate having had the opportunity to share my experiences and recommendations at a conference.

Ha, I was happy that Josh was able to come to my talk, since he missed the Pittsburgh Scala meetup on Wednesday!

comments powered by Disqus