title: Replace comma as separator
body: <p>I am trying to build a Regex to replace commas used as a separator in between normal text.</p>
  
  <p>Different ways I can replace that is valid:</p>
  
  <ul>
  <li>Space before comma</li>
  <li>Comma is between text and/or numbers, without any space</li>
  <li>Several commas after each other</li>
  </ul>
  
  <p>Example:</p>
  
  <pre><code>"This is a text separated with comma, that I try to fix. , It can be split in several ways.,1234321  , I try to make all the examples in one string,,4321,"
  </code></pre>
  
  <p>Results:</p>
  
  <ul>
  <li>This is a text separated with comma, that I try to fix.</li>
  <li>It can be split in several ways.</li>
  <li>1234321</li>
  <li>I try to make all the examples in one string</li>
  <li><br> </li>
  <li>4321</li>
  </ul>
  
  <p>This is the code I have so far using Node.js / Javascript:</p>
  
  <pre><code>data.replace(/(\S,\S)|( ,)|(,,)|(,([a-z0-9]))/ig,';')
  </code></pre>
  
  <hr>
  
  <p>The answer from @torazaburo work best, except for several commas with space in-between (, , , ,) </p>
  
  <pre><code>console.log(str.split(/ +, *|,(?=\w|,|$)/));
  </code></pre>