title: how do I extract a simple string pattern?
body: <p>I have a set of strings in the format of &quot;Document HH:MM:SS DD-MM-YY&quot; where the upper case letters denote numbers.</p>
  <p>I want to be able to process them into something like</p>
  <pre><code>[hh,mm,ss,dd,mm,yy] = string.process(&quot;Document XX:XX:XX XX-XX-XX&quot;)
  </code></pre>
  <p>so basically I tell Python that anything X in string should be copied to one of the outputs, and each contiguous sequence of X's is a single output in the left handside array.</p>
  <p>Is that possible in an easy way in Python?</p>
  <p>Since everything is in fixed indices, I could use substrings with fixed indices, but would rather not.</p>