title: How do I modify \1 in gsub?
body: <p>When I see some text that matches my pattern, I want to create a link to an external site using RedCloth that has a query link for it.</p>
  
  <p>If I have something like:</p>
  
  <pre><code>Text 123 1234 12345
  </code></pre>
  
  <p>When I see that I want to replace it with:</p>
  
  <pre><code>"Text 123 1234 12345":http://site.com/query?value=Text%20123%201234%2012345
  </code></pre>
  
  <p>If I let it keep the spaces, RedCloth won't notice this as a link correctly.</p>
  
  <p>Here is where I am at:</p>
  
  <pre><code>s = "this is a string which has Text 123 1234 12345 "
  
  s = s.s.gsub(/(Text \d+ \d+ \d+)/,'"\1":http://site.com/query?value=\1'
  
  =&gt; "Text 123 1234 12345":http://site.com/query?value=Text 123 1234 12345"
  </code></pre>
  
  <p>The probem is that RedCloth stops parsing after:</p>
  
  <pre><code> "Text 123 1234 12345":http://site.com/query?value=Text 
  </code></pre>
  
  <p>So I really need:</p>
  
  <pre><code>"Text 123 1234 12345":http://site.com/query?value=Text%20123%201234%2012345"
  </code></pre>
  
  <p>Is there a way I can mess with <code>\1</code> in the right hand side of <code>gsub</code>, such that I could get the following?  If not, what's the best way to do this?</p>