Extract numbers from string without any spaces
<p>I have strings like 6M1D14M. I would like to extract all the numbers from this string. Something like: </p>

<pre><code>[6, 1, 14]
</code></pre>

<p>How do I do that? The length of the string can be arbitrary. Numbers that are present in between might also be of any length.</p>

<p>I have tried <a href="https://stackoverflow.com/questions/4289331/python-extract-numbers-from-a-string">this</a> approach but unable to split the string the way I need.</p>