title: Parsing name-value pairs in Java
body: <p>Is there any open source solution, or a generic regex for parsing name-value (key-value) pairs  out of a random String, in Java, with the (optional) delimiters stripped out?</p>
  
  <p>From a <a href="https://stackoverflow.com/questions/168171/regular-expression-for-parsing-name-value-pairs">Regular expression for parsing name value pairs</a>, one such regex could be</p>
  
  <pre><code>"((?:\"[^\"]*\"|[^=,])*)=((?:\"[^\"]*\"|[^=,])*)"
  </code></pre>
  
  <p>However, the above (and its variations on the aforementioned question), although working as expected, return the delimiters along with the value.</p>
  
  <p>For instance, a pair like <strong><code>key="value"</code></strong> will produce <strong>{key</strong>, <strong>"value"}</strong> instead of <strong>{key, value}</strong>.</p>
  
  <p>The latter form of output would be nicer, since it avoids string post-processing to remove the enclosing delimiters (quotes in this case).</p>