title: Python doesn't recognize regex pattern - Number between 1 and 6 digits
body: <p>I have a problem, I try to recognize a pattern among a list of words. I need to find a number of 1 to 6 digits with or without characters around.</p>
  <p>my input is this: [1]: <a href="https://i.stack.imgur.com/RNOdL.png" rel="nofollow noreferrer">https://i.stack.imgur.com/RNOdL.png</a></p>
  <p>With the OCR I obtained:</p>
  <pre><code>Kundennummer:
  21924
  </code></pre>
  <p>The pattern r&quot;(\D|\A)+<strong>\d{5}</strong>(\D|\Z)+&quot; works but when I change it to r&quot;(\D|\A)+<strong>\d{1,6}</strong>(\D|\Z)+&quot; it doesn't.</p>
  <p>I used re.match, re.findall and re.search and none of them works</p>
  <p>the repr():</p>
  <pre><code>'Kundennummer:'
  '21924'
  </code></pre>