title: Python Regex Non-Capturing Group
body: <p>I am trying to understand re.split() function with non-capturing group to split a comma delimited string.</p>
  
  <p>This is my code:</p>
  
  <pre><code> pattern = re.compile(r',(?=(?:"[^"]*")*[^"]*$)')
   text = 'qarcac,"this is, test1",123566'
   results= re.split(pattern, text)
   for r in results:
      print(r.strip())
  </code></pre>
  
  <p>When I execute this code, the results are as expected. </p>
  
  <p><strong>split1</strong>: qarcac</p>
  
  <p><strong>split2</strong>: "this is, test1"</p>
  
  <p><strong>split3</strong>: 123566</p>
  
  <p>whereas if i add one more double quoted string to the source text, it doesn't work as expected.</p>
  
  <pre><code>text = 'qarcac,"this is, test1","this is, test2", 123566, testdata'
  </code></pre>
  
  <p>and produces the below output</p>
  
  <p><strong>split1</strong>: qarcac,"this is, test1"</p>
  
  <p><strong>split2</strong>: "this is, test2"</p>
  
  <p><strong>split3</strong>: 123566</p>
  
  <p>Can someone explain me what's going on here and how non-capturing group works differently in these two cases?</p>