Qmail_regex is a patch to qmail (v1.02, but should work with others too) that brings the power of regular expressions to the control/locals file.