title: Regular expression for tokenizing connection string
body: <p>I have 2 different types of connection strings (because of legacy reasons that I can't fix everywhere for various reasons which are irrelevant here). I need to break them up into key/value pairs. Here are the sample connection strings:</p>
  
  <pre><code>1. Server=SomeServer;Database=SomeDatabase;Something=Hello
  2. Server=SomeServer,Database=SomeDatabase;Something=Hello
  3. Server=SomeServer,1111;Database=SomeDatabase;Something=Hello 
  </code></pre>
  
  <p>For the first 2 cases, I can use the regex:</p>
  
  <pre><code>(?&lt;Key&gt;[0-9A-z\s]+)=(?&lt;Val&gt;[0-9A-z\s,]+?[0-9A-z\s]+)
  </code></pre>
  
  <p>For the third one, I can use the regex:</p>
  
  <pre><code>(?&lt;Key&gt;[0-9A-z\s]+)=(?&lt;Val&gt;[0-9A-z\s]+?[0-9A-z\s,]+)
  </code></pre>
  
  <p>How do I turn this into one regex that would work for all cases?</p>