title: Python: Regex to extract strings from a file name that follows a specific pattern
body: <p>I have file name in the below format:</p>
  <pre><code>&lt;IndentNo&gt;_&lt;DocType&gt;_&lt;DocName&gt;_&lt;Date&gt;_&lt;Version&gt;.&lt;Extension&gt;
  An Example: 
  1000023456_SOTR_FILE23_21102020_V1.pdf
  </code></pre>
  <p>I want to retrieve <code>&lt;IndentNo&gt;</code>,<code>&lt;DocType&gt;</code>,<code>&lt;DocName&gt;</code> separately. I am not well conversant with Regex thus seeking help. Ideally my code snippet should be as follows:</p>
  <pre><code>IndentNo, DocType, DocName = re.findall('regex pattern', file_name,re.I)[0],\
                               re.findall('regex pattern', file_name,re.I)[1],\
                               re.findall('regex pattern', file_name,re.I)[2]
  IndentNo, DocType, DocName = '1000023456','SOTR','FILE23'
  </code></pre>
  <p>I am looking for the suitable <code>regex pattern</code> for each category of string.
  Following <a href="https://stackoverflow.com/questions/53750596/regex-expression-for-file-name-with-2-underscores-and-3-segments">this SO thread</a>, I have no luck so far.</p>
  <p>Any help would be appreciated.</p>