import re


def normalize_voucher_template(template):
    """
    Turns template placeholders of form
    '{voucher}' into '{voucher.*.0}'
    and
    '{voucher.foo}' into '{voucher.foo.0}'
    """
    template = re.sub(r'{voucher}','{voucher.*.0}',template)
    template = re.sub(r'{voucher\.([^\.}]+)}',r'{voucher.\1.0}',template)
    return template