Move regex and configuration constants to module scope