title: Escape comma when using String.split
body: <p>I'm trying to perform some super simple parsing o log files, so I'm using <code>String.split</code> method like this:</p>
  
  <pre><code>String [] parts = input.split(",");
  </code></pre>
  
  <p>And works great for input like:</p>
  
  <pre><code>a,b,c
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>type=simple, output=Hello, repeat=true 
  </code></pre>
  
  <p>Just to say something.</p>
  
  <p>How can I escape the comma, so it doesn't match intermediate commas?</p>
  
  <p>For instance, if I want to include a comma in one of the parts:</p>
  
  <pre><code>type=simple, output=Hello, world, repeate=true
  </code></pre>
  
  <p>I was thinking in something like:</p>
  
  <pre><code>type=simple, output=Hello\, world, repeate=true
  </code></pre>
  
  <p>But I don't know how to create the split to avoid matching the comma.</p>
  
  <p>I've tried:</p>
  
  <pre><code>String [] parts = input.split("[^\,],");
  </code></pre>
  
  <p>But, well, is not working. </p>