Templated regular expressions