http://www.perlmonks.org?node_id=34552


in reply to Regexes vs. Maintainability

This is purely anecdotal, of course, but regexes are just plain fun - to write, anyway. Supporting other people's can be a major source of annoyance. How many of them are really understandable to the average coder?

Personally, I prefer a general comment and then comments on specific parts only if the expression is particularly intricate (as in the example above). In any case, I would be interested to see how many people really bother to comment their regexes beyond "parses $var" or some such thing. I'm sure there are plenty of horror stories floating around.