I hate regular expressions. Although I see their obvious value in web development, they are simply a pain in the ass to write and next-to-impossible to understand at first glance. I can’t imagine that anyone actually likes writing regular expressions, but if anyone out there actually does I’d certainly love to hear why.
Thankfully, there’s a number of resources freely available on the internet which make writing regular expressions a far less painful experience. Here is a list of my personal favorites:
I found this page a while back while trying to implement some filters on a Google Analytics account. The page isn’t anything spectacular, but Google has done a fine job attempting to explain regular expression syntax in terms most people can understand. I like to use this resource when writing a simple small regular expression.
Quanetic Regular Expression Tester
This tool allows you to quickly test a regular expression against an input string. Quanetic has also listed some “Helpful Hints” below the testing form, though I don’t think it’s quite as helpful as the Google Analytics page.
txt2re Regular Expression Generator
A coworker recently told me about this site, and I’m pretty impressed. After typing an input string into a text field, the tool allows you to select which parts of the string you want to isolate via a regular expression. The coolest part of this tool is that it actually generates the code for your regular expression in your choice of 15 languages.