title: Repetition on a backward look around regular expression
body: <p>I'm having issues retrieving a particular set of text from a file name using regular expressions, below you can see what I mean.</p>
  
  <p>From this example I'm interested in extracting "1-2-19".</p>
  
  <blockquote>
    <p>28-3G__1-2-19 02252019.xlsx</p>
  </blockquote>
  
  <p>From this example I'm interested in extracting "1-5-19".</p>
  
  <blockquote>
    <p>12H-14W_1-5-19 02252019.xlsx</p>
  </blockquote>
  
  <p>From this example I'm interested in extracting "11-12-18"</p>
  
  <blockquote>
    <p>343X-N_11-12-18.xlsx</p>
  </blockquote>
  
  <p>Currently the expresion I'm using is:</p>
  
  <pre><code>(?&lt;=_)(.*?)(?=( +[0-9]{8})?\.xlsx)
  </code></pre>
  
  <p>Which returns the results I want for the last 2 examples, however, for the first one, it retrieves "_1-2-19", and that extra underscore is giving me issues.</p>
  
  <p>I have tried with repetitions of different sorts, but nothing seems to work. Any idea would be highly appreciated.</p>
  
  <p>These are different approaches I have tried with no success:</p>
  
  <pre><code>(?&lt;=(_|__))(.*?)(?=( +[0-9]{8})?\.xlsx)
  
  (?&lt;=__?)(.*?)(?=( +[0-9]{8})?\.xlsx)
  
  (?&lt;=_+)(.*?)(?=( +[0-9]{8})?\.xlsx)
  </code></pre>