Let's say a format string is given as export_%05u.png, we can create a full string in python by supplying an integer like this s = "export_%05u.png"%1. But If we have the format string and actual string, is it possible to extract the integer somehow?
Formally, these are given: export_%05u.png and export_00111.png and we need to extract 111.
%conversion, then match the literal characters in the format string to the actual string, remove them from the actual string, and then interpret the remaining characters as the appropriate type.scanf("printf") tokens to regular expressions, see the documentation for the re module.