add regexp validation to template