assembling regular expressions from reusable patterns (a Python logstash grok clone)