title: Identifying the space in commas with regular expression
body: <p>I have a data separated by spaces, but one of the data has special format with commas. </p>
  
  <p>For example:</p>
  
  <pre><code>A B C,D,E,F G H
  </code></pre>
  
  <p>The start of comma group is detected with "[^\s]+\,", and the end of the group is with "\,[^\s+]".
  In this example, the comma group starts with "C," and ends with ",F". The number of commas is more than one. 
  There is only one comma group, but the location can vary.</p>
  
  <p>I can use <code>\s+</code> to separate 5 data groups ([A],[B],[C,D,E,F],[G],[H]), but the issue is that there can be spaces in the data in the data group that has comma in it. </p>
  
  <p>For example:</p>
  
  <pre><code>A B C,D E F,G H I,J K L M
  </code></pre>
  
  <p>There is no spaces before and after comma.</p>
  
  <p>In this case, We have 6 groups ([A], [B], [C,D E F,G H I,J], [K], [L], [M]). </p>
  
  <p>How can I get this result with regular expression? I'm using Python and Scala.</p>