title: How do I use 'gsub' to make multiple substiuttions?
body: <p>I have a string that only contains one number on either side of <code>"-"</code>, like:</p>
  
  <pre><code>"1-3"
  </code></pre>
  
  <p>I want to get a result like</p>
  
  <pre><code>"01-03"
  </code></pre>
  
  <p>If the string had two numbers on one side of the dash like:</p>
  
  <pre><code>"1-10"
  </code></pre>
  
  <p>then I don't want to make any substitutions. I could do a <code>gsub</code> expression like</p>
  
  <pre><code>str.gsub!(/(^|[^\d]])\d[[:space:]]*\-[[:space:]]*\d([^\d]|$)/, '\1')
  </code></pre>
  
  <p>but I'm not clear how to do it if there are multiple (e.g. two) things to substitute.</p>