title: This regex doesn't work in c++
body: <p>It is supposed to match <code>"abababab"</code> since <code>"ab"</code> is repeated more than two times consecutively but the code isn't printing any output.
   Is there some other trick in using regex in C++.</p>
  
  <p>I tried with other languages and it works just fine.</p>
  
  <pre><code>#include&lt;bits/stdc++.h&gt;
  
  int main(){
  
    std::string s ("xaxababababaxax");
    std::smatch m;
    std::regex e ("(.+)\1\1+");   
  
     while (std::regex_search (s,m,e)) {
      for (auto x:m) std::cout &lt;&lt; x &lt;&lt; " ";
      std::cout &lt;&lt; std::endl;
      s = m.suffix().str();
    }
  
    return 0;
  }
  </code></pre>