title: C++ Regex to extract all possible 10 digit numbers from a string
body: <p>I want to create a <strong>scraper</strong> , to studying. I try to get all exactly 10 digit long numbers possible in a file.</p>
  <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  #include &lt;regex&gt;
  
  int main()
  {
      std::string subject(&quot;098765432123 1234567890&quot;);
      try {
          std::regex re(&quot;[0-9]{10}&quot;);
          std::sregex_iterator next(subject.begin(), subject.end(), re);
          std::sregex_iterator end;
          while (next != end) {
              std::smatch match = *next;
              std::cout &lt;&lt; match.str() &lt;&lt; &quot;\n&quot;;
              next++;
          }
      } catch (std::regex_error&amp; e) {
          // Syntax error in the regular expression
      }
  }
  </code></pre>
  <p>My output is :</p>
  <pre><code>0987654321
  1234567890
  </code></pre>
  <p>But with this string &quot;098765432123 1234567890&quot; I want to obtain all numbers like :</p>
  <pre><code>0987654321
  9876543212
  8765432123
  1234567890
  </code></pre>
  <p>I don't know if the problem come from my regex or from next++</p>
  <p>Thanks for your advise.</p>