title: Ruby regex what does the \1 mean for gsub
body: <p>What does the \1 do?</p>
  
  <p>For example</p>
  
  <pre><code>"foo bar bag".gsub(/(bar)/,'car\1')
  </code></pre>
  
  <p>I believe it has something to do with how you use parentheses, but I'm not really sure.  Could someone explain it to me? And can you do stuff like \2?  If so, what would that do?</p>