title: Matching string between nth occurrence of character in python with RegEx
body: <p>I'm working with files in a tar.gz file which contains txt files and trying to extract the filename of a the related <code>TarInfo</code> object whose <code>member.name</code> property looks like this:</p>
  
  <pre><code>aclImdb/test/neg/1026_2.txt
  aclImdb/test/neg/1027_5.txt
  ...
  aclImdb/test/neg/1030_4.txt
  </code></pre>
  
  <p>I've written the following code which prints the string <code>test/neg/1268_2</code></p>
  
  <pre><code>regex = '\/((?:[^/]*/).*?)\.'
  with tarfile.open("C:\\Users\\Orestis\\Desktop\\aclImdb_v1.tar.gz") as archive:
      for member in archive.getmembers():
           if member.isreg():
           m = re.findall(regex, member.name)
           print(m)
  </code></pre>
  
  <p>How should I modify the regex to extract only the <code>1268_2</code> part of the filenames? Effectively I want to extract the string after the 3rd occurrence of <code>"/"</code> and before the 1st occurrence of <code>"."</code>.</p>