title: regex in Python to remove commas and spaces
body: <p>I have a string with multiple commas and spaces as delimiters between words. Here are some examples:</p>
  
  <pre><code>ex #1: string = 'word1,,,,,,,     word2,,,,,,     word3,,,,,,'  
  ex #2: string = 'word1         word2       word3'  
  ex #3: string = 'word1,word2,word3,'  
  </code></pre>
  
  <p>I want to use a regex to convert either of the above 3 examples to "word1, word2, word3" - (Note: no comma after the last word in the result).</p>
  
  <p>I used the following code:</p>
  
  <pre><code>import re
  input_col = 'word1    ,   word2     , word3,    '
  test_string = ''.join(input_col)
  test_string = re.sub(r'[,\s]+', ' ', test_string)
  test_string = re.sub(' +', ',', test_string)
  print(test_string)  
  </code></pre>
  
  <p>I get the output as "word1,word2,word3,". Whereas I actually want "word1, word2, word3". No comma after word3.</p>
  
  <p>What kind of regex and re methods should I use to achieve this?</p>