expand regex for templates, allowing the syntax to be less strict re: whitespace