title: regexp for find key value pairs separated by colon
body: <p>I'm having trouble coming up with a regular expression for a string in the given form:</p>
  
  <pre><code>123123&lt;key:value&gt;&lt;key:value&gt;,21313&lt;key:value&gt;&lt;key:value&gt;
  </code></pre>
  
  <p>where the key:value pairs are optional, but we must not have two colons in the same key:value pairs.</p>
  
  <p>I've gotten this far:</p>
  
  <pre><code>^((\d+)(&lt;(.+?):(.+?)&gt;)*)(,\d+)(&lt;(.+?):(.+?)&gt;)*$
  </code></pre>
  
  <p>some valid texts:</p>
  
  <ul>
  <li><code>123131</code>  </li>
  <li><code>123131, 123131, 1213313</code>  </li>
  <li><code>12313&lt;key:value&gt;</code>  </li>
  <li><code>232133&lt;key:value&gt;&lt;key:value&gt;,232133&lt;key:value&gt;&lt;key:value&gt;</code>  </li>
  </ul>