Use Python format string in reverse for parsing
<p>I've been using the following python code to format an integer part ID as a formatted part number string:</p>

<pre><code>pn = 'PN-{:0&gt;9}'.format(id)
</code></pre>

<p>I would like to know if there is a way to use that same format string (<code>'PN-{:0&gt;9}'</code>) in reverse to extract the integer ID from the formatted part number. If that can't be done, is there a way to use a single format string (or regex?) to create and parse?</p>
