title: Javascript regex placeholder prints string instead of its value
body: <p>I have a javascript function which looks for a string of certain format and then converts it into a link</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
  var re = /Ticket-([0-9]*?(?=-)-[0-9]*)/; 
  var str = 'ASD Ticket-492-367 - Make my day.'; 
  t = str.replace(re,'&lt;a href="http://myworld/ticket/$1"&gt;$0&lt;/a&gt;')
  document.write(t);
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>It looks for Ticket-[some numbers]-[somenumbers] and converts it into a link. Now when i run it seperately in JS editors online it works. But when I run it in my script and lok at the page it does convert the string into a list but prints out literal $0 on the page instead of its value. Is my Javascript correct or ist something else in my script that's probably cuasing the erraneous relsuts. As always, any help is appreciated. </p>