For anyone that's ever struggled with making a regular expression "feel right" in their code, you might want to check out this new article from ONLamp.com.
In Five Habits for Successful Regular Expressions the author of the Regular Expression Pocket Reference give you five easy-to-remember tips that can help you and your regular expressions get along a little bit better (and maybe even live happily ever after). Suggestions like Group the Alternation Operator and Use Whitespace and Comments can help you craft better and more efficient regular expressions for your code. Many of the suggestions listed are things that can not only make your matches cleaner, but can also speed up your code dramatically.
Many thanks to PHPEverywhere for the pointer to this one...




