new feature: accept a string as the template, support all string pattern generators.