Python is complaining that there are other {
and }
in your string not used for format, and it doesn't know how to tell the difference. In a format string, braces are escaped by doubling them.
You also need to escape any regex characters in your value
.
So perhaps:
ORF = re.findall(
r'ATG(?:(?!TAA|TAG|TGA)…){{{},}}?(?:TAA|TAG|TGA)'
.format(re.escape(value)),
seq)
In a case like this, though, I doubt anyone would fault you for using %
-formatting or good old string concatenation instead :)