Python string extraction
<p>In the following string how to get the id after the directory media and after getting the id ignore the rest of the string to read only the id numbers</p>

<pre><code>id_arr= ["/opt/media/12/htmls","/opt/media/24/htmls","/opt/media/26/htmls","/opt/media/56/htmls"]
</code></pre>

<p>The output should be 12 24 26 56</p>
