Regular Expressions

I am not sure how someone with my background got to this point in life without learning regular expressions. I minored in computer science in college and took a few more classes in graduate school. I took a class on models of computation that included regular languages. I ended up in the area of mathematics most strongly associated with Stephen Kleene, computability/recursion theory, and am a great admirer of his.

And yet, here I was, with an understanding of regular expressions generously described as “rudimentary.” I decided to fix that recently with the help of Kevin Skoglund, Regular-Expressions.info, and Regular Expressions 101. That last site lets you input an expression and text and not only shows you matches, but takes apart your expression and describes what it’s doing, and shows you the content of any captures that were made. Learning regex felt like being given a secret decoder ring, and it didn’t take long at all to learn (the Lynda course, which I recommend, is a bit over 5.5 hours, but the last two are examples).

I also used single pages found via Google searches and on Stack Overflow, and the Perl documentation, though unfortunately the Perl site is nigh unnavigable. Finally, though it’s flagged with multiple issues, Wikipedia has a comparison of regular expression engines that includes which additions to ERE are and are not supported by different regex flavors.

I’ve typed up my notes from all these sites, and should I decide to make them pretty you’ll probably see them here.

Leave a Reply

Your email address will not be published. Required fields are marked *