Extract only numbers from a string with punctuation and spaces in R? : <p>How would I extract only the numbers using a regular expression from the following string:</p>

<pre><code>+1 Ab_Cd- 001 234.txt`
</code></pre>

<p>Such that I return:</p>

<pre><code>1001234
</code></pre>

<p>I have a data frame with a vector of such strings. I'm trying to do the above in both R and Python. I'm more familiar with R's <code>stringr</code> and <code>gsub()</code> from <code>base</code>. I've tried multiple expressions but can't get anything that works well.</p>
