title: Regex replace but ignore last character
body: <p>I am trying to replace </p>
  
  <pre><code>/ok/how/are
  </code></pre>
  
  <p>with </p>
  
  <pre><code>$ok, $how, $are
  </code></pre>
  
  <p>using regex</p>
  
  <pre><code>str.replace(/\/([0-9a-zA-Z]+)/g, '\$$1,')
  </code></pre>
  
  <p>and result is </p>
  
  <pre><code>$ok, $how, $are, 
  </code></pre>
  
  <p>I can't use another statement to remove last leading <code>,</code> how can I get desire result without last <code>,</code></p>