use regular expressions for templates