title: How to get only the number from a string?
body: <p>I have strings like this:</p>
  
  <blockquote>
    <p>Lesson 001: Complete</p>
  </blockquote>
  
  <p>I want to only get the number part, in this case <code>001</code>.</p>
  
  <p>I tried this:</p>
  
  <pre><code>  $str = the_title();
    preg_match_all('!\d+!', $str, $matches);
    $number = implode(' ', $matches[0]);
    echo $number;
  </code></pre>
  
  <p>But <code>echo $number</code> outputs the entire string once again: <code>Lesson 001: Complete</code></p>
  
  <p>How to do this correctly?</p>