title: Using a replace pattern in preg_replace replacement parameter
body: <p>I'm trying to use PHP's <code>preg_replace</code> to replace every <code>#CODE-123</code> kind of token to <code>/CODE-123</code>. </p>
  
  <p>It works pretty well except for one last detail, I'd need to remove the <code>#</code> from the string the second time I use it but I cannot figure out how. </p>
  
  <p>Here's what I have so far: </p>
  
  <pre><code>echo preg_replace('/#.*-[0-9]*/i', '[${0}](/${0})', $this-&gt;description);
  </code></pre>
  
  <p>It works and replaces #CODE-123 to <code>[#CODE-123](/#CODE-123)</code> but I'd need it to be <code>[#CODE-123](CODE-123)</code> instead. </p>
  
  <p>Any idea? Thanks!</p>