Back in my Windows system engineering and administration days I worked in a group that included Unix system engineers in addition to us Windows geeks. I was always impressed by the power of the Unix grep text search utility but even more amazed at the dexterity with which the Unix admins could whip out a regular expression (regex) for “grepping” all kinds of information from systems. We didn’t work much with regular expressions in the Windows world at that time so the grepping Unix admins seemed to be working a lot of black magic.
Once I made the jump to full-time web development it became apparent that the black magic of regular expressions wielded a lot of power and utility in coding scenarios. From data validation for email addresses and URLs to searching for a piece of code, regular expressions empower a whole host of extremely powerful text search abilities.
Unfortunately, I still lack the divinely-granted expertise of the Unix admin when it comes to regular expressions so I often have to resort to one of my favorite code resource sites ever: http://www.regular-expressions.info/ from Jan Goyvaerts. This wonderful corner of the web provides a host of critical regular expression expertise, including tutorials, references and other educational materials. Best of all, though, especially if you’re a somewhat lazy programmer (or just too busy!) like me, the site includes lots of examples of regular expressions. The examples not only quickly solve many common regular expression needs for data validation but include a thorough explanation of each example to help you learn the nuances of the regular expression language.