Say you wanted to create a pattern that matches sequences of var
consecutive digits. You could do it this way:
p = re.compile(r"\d{"+str(var)+"}")
or this way:
p = re.compile(r"\d{%d}" % var)
But how would you do it using format()?
I tried both:
p = re.compile(r"\d{0}".format(var))
and:
p = re.compile(r"\d{{0}}".format(var))
but none of these worked.