title: Why will regex "([a-z])((?!\\1)[a-z])" match string "aa" in C++11?
body: <p>Indeed running</p>
  
  <pre><code>regex pattern("([a-z])((?!\\1)[a-z])");
  cout &lt;&lt; regex_match("aa", pattern) &lt;&lt; endl;
  </code></pre>
  
  <p>results in the output "1", yet the first group matched is "a", and if instead I run</p>
  
  <pre><code>regex pattern("([a-z])((?!a)[a-z])");
  cout &lt;&lt; regex_match("aa", pattern) &lt;&lt; endl;
  </code></pre>
  
  <p>I get "0" as expected.</p>
  
  <p>Note that exactly the same regex works as expected in Python 3, i.e. running</p>
  
  <pre><code>re.match("([a-z])((?!\\1)[a-z])", "aa")
  </code></pre>
  
  <p>produces no matches. Can someone explain what is happening here?</p>
  
  <p>Just for reference, I am using g++ (tdm64-1) 5.1.0 with flags -O2 and -std=c++11.</p>