Add an escape-for-regex func and use it when building regex's on the fly.