title: Python regex negative extract of an optional group
body: <p>I have some dates in strings like</p>
  <pre><code>dates = ['052021','01052021','02112021']
  </code></pre>
  <p>Some dates contain the day in between like %m%d%Y and some not, like %m%Y.
  I need to be able to extract so that the previous list comes as</p>
  <pre><code>dates = ['052021','012021','022021']
  </code></pre>
  <p><strong>I can only do it using regex and in one expression</strong>, I have tried something like using the pattern '(\d{2}(?:(\d{2})\d{4})' without any luck.</p>