I have multiple files of the format myfilexyz-200407171758.tar.gz
(myfilexyz)-(200407171758).tar.gz
Group1 is a variable.
Group2 can be of 12 to 14 digits.
Using variable substitution, I can get this working
r = re.compile('(%s)-(\d){12,13}.tar.gz' %myvar)
But if I were to try the newer format method, I get into trouble
r = re.compile('({})-(\d){12,14}.tar.gz'.format(myvar))
key '12,14' has no corresponding arguments
Obviously the {12,14} is messing up format. Is there a way around this problem and still use the format method for substitution?