How to extract a substring from inside a string?
<p>Let's say I have a string <code>/Apath1/Bpath2/Cpath3/0-1-2-3-4-5-something.otherthing</code> I want to extract just the '0-1-2-3-4-5' part. I tried this:</p>

<pre><code>str='/Apath1/Bpath2/Cpath3/0-1-2-3-4-5-something.otherhing'

print str[str.find("-")-1:str.find("-")]
</code></pre>

<p>But, the result is only 0. How to extract just the '0-1-2-3-4-5' part?</p>
