title: Can I use $1 in regex_replace?
body: <p>From reading the FCD for <code>regex_replace</code> (28.11.4) I can only <em>guess</em> that the function can also <strong>use parts of the original string for replacing?</strong> I can not test it with my gcc, is this correct?</p>
  
  <pre><code>using namespace std;
  regex rx{ R"((\d+)-(\d+))" }; // regex: (\d+)-(\d+)
  cout &lt;&lt; regex_replace("123-456", rx, "b: $2, a:$1");
  // "b: 456, a:123"
  </code></pre>
  
  <p>As you can see, I assume <code>$1</code> and <code>$2</code> refer to the <em>"()" capturing groups</em> (and not <code>\1</code> and <code>\2</code> like elsewhere).</p>
  
  <p><strong>Update.</strong> So, I guess this is a two-part question</p>
  
  <ul>
  <li><strong>Is this use of <em>capturing groups</em> in the replacement text supported at all?</strong></li>
  <li><strong>Is the default ECMAScript syntax using <code>$</code><em>n</em>?</strong> Or <code>\</code><em>n</em>?</li>
  </ul>