in reply to Re: Regexes vs. Maintainability
in thread Regexes vs. Maintainability

I tend to comment regexps like this:

$path=~/^\s*([\w-]+) # elt \s*\[\s*\@ # [@ ([\w-]+) # att $1 \s*=\s*(["']) # = " (or ',) $2 (.*?) # value $3 \3\]\s*$/gx) # "] (or ')

It works very well for moderately complex regexps.