title: Regex pattern for multi-episode file names
body: <p>I'm trying to write a regular expression to get data about TV show episodes from a file name.</p>
  
  <p>I'll start with showing a few examples of the kind of inputs I'm dealing with and how I'd like the data output.</p>
  
  <p><strong>Input:</strong></p>
  
  <ul>
  <li>showname.s01e01e02e03.extension</li>
  <li>showname.s01e01-02-03.extension</li>
  </ul>
  
  <p><em>Note: The amount of episodes can vary, but will at least be 2.</em></p>
  
  <p><strong>Output:</strong></p>
  
  <ul>
  <li>Season number, i.e. '01' from s01</li>
  <li>Episode numbers, i.e. 01e02e03 or 01-02-03</li>
  </ul>
  
  <p><em>Note: If it's possible to get individual episode numbers using regex, that'd be great as well - if not, I'll just split them.</em></p>
  
  <p><strong>What I've tried:</strong></p>
  
  <p>I'm <a href="https://stackoverflow.com/questions/17098834/split-string-with-dot-while-handling-abbreviations">not really that great with regular expressions</a>, so my current attempt is probably horrible. Anyway, here's what I've got so far - obviously not working:</p>
  
  <pre><code>(?i)s(?&lt;season&gt;\\d{1,4})(e(\\d{1,3})){2,}
  </code></pre>
  
  <p>My idea was to create a group for the season number (that part works), and then try to match the episode numbers based on the repetition, but yeah, it's 3.41 AM here and I can't really wrap my head around it.</p>
  
  <p>A complete solution would be nice, but any ideas or pointers are very much appreciated :-)</p>
  
  <p><em>PS. I'll add a bounty if the accepted answer contains an explanation of the regex in order to help both myself and others learn.</em></p>