title: javascript regular expression, allow only numbers and commas
body: <p>Okay, I'm needing some help with a regular expression replace in javascript.</p>
  
  <p>I have this function which takes everying out but numbers.. but I need to allow commas as well.</p>
  
  <pre><code>function validDigits(n){
  return n.replace(/\D+/g, '');}
  </code></pre>
  
  <p>I'm still pretty cloudy on regex syntax, so if anyone could help me out I would greatly appreciate it.</p>