title: C++11 regex: digit after capturing group in replacement string
body: <p>My regex_replace expression uses group $1 right before a '0' character in the replacement string like so:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;regex&gt;
  
  using namespace std;
  
  int main() {
      regex regex_a( "(.*)bar(.*)" );
      cout &lt;&lt; regex_replace( "foobar0x1", regex_a, "$10xNUM" ) &lt;&lt; endl;
      cout &lt;&lt; regex_replace( "foobar0x1", regex_a, "$1 0xNUM" ) &lt;&lt; endl;
  }
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>xNUM
  foo 0xNUM
  </code></pre>
  
  <p>I'm trying to get output <code>foo0xNUM</code> without the middle whitespace.</p>
  
  <p>How do I guard the group name $1 from the next character in the substitution string?</p>