title: Count number of matches
body: <p>How do I count the number of matches using C++11's <code>std::regex</code>?</p>
  
  <pre><code>std::regex re("[^\\s]+");
  std::cout &lt;&lt; re.matches("Harry Botter - The robot who lived.").count() &lt;&lt; std::endl;
  </code></pre>
  
  <p>Expected output:</p>
  
  <blockquote>
    <p>7</p>
  </blockquote>