Move regular expression generation into METAs

This is preferable for the purposes of getting the module running faster
and is also friendlier with pylint.