title: use regex to replace all but first occurrence of a substring of blanks
body: <p>The following statement runs fine:</p>
  
  <pre><code>$wb.upLinearLoad.append('&lt;div&gt;' + sprintf("%5s%8.1f to%7.1f%8.1f%6.0f%8.0f",sLinearSegName[i][j],fLinearPtBA[i][j],fLinearPtBA[i][j+1],fLen,fLinearPtPpi[i][j],fLinearSegMaxWt[i][j]).replace(/ /," &amp;nbsp;") + '&lt;/div&gt;');
  </code></pre>
  
  <p>However, I now have a need to dynamically change the color of the last two variables only, so I decided to enclose them in a span with a class='wt' to control their color. This gives:</p>
  
  <pre><code>$wb.upLinearLoad.append('&lt;div&gt;' + sprintf("%5s%8.1f to%7.1f%8.1f&lt;span class='wt'&gt;%6.0f%8.0f&lt;/span&gt;",sLinearSegName[i][j],fLinearPtBA[i][j],fLinearPtBA[i][j+1],fLen,fLinearPtPpi[i][j],fLinearSegMaxWt[i][j]).replace(/ /," &amp;nbsp;") + '&lt;/div&gt;');
  </code></pre>
  
  <p>which fails because the space between span and class gets changed to <code>&amp;nbsp;</code></p>
  
  <p>My regex ability goes only as far the example, so the question becomes how do I change all but the first space to <code>&amp;nbsp;</code>?</p>
  
  <p>Any and all suggestions are most welcome, and especially if you see that my whole approach is poor. </p>