title: How can I replace every instance of a pattern in ruby?
body: <p><code>string.sub</code> looks like it only replaces the first instance. Is there an option for that or another method that can replace all patterns? Can you do it inside a regex like perl?</p>
  
  <p>(I think something like r/blah/blah/)</p>
  
  <p>... and +1 to anyone who can tell me WHY ON EARTH does <code>string.sub</code> replace just the FIRST match?</p>