title: Reg-ex to match statsD Format
body: <p>I am using the following reg-ex to match StatsD data format - </p>
  
  <pre><code>^[\w.]+:.+\|.\|#(?:[\w.]+:[^,\n]+(?:,|$))*$
  </code></pre>
  
  <p>This satisfies any of the following formats - </p>
  
  <pre><code>performance.os.disk:1099511627776|g|#region:us-west-1,datacenter:us-west-1a
  </code></pre>
  
  <p>or</p>
  
  <pre><code>performance.os.disk:1099511627776|g|#
  </code></pre>
  
  <p>or</p>
  
  <pre><code>performance.os.disk:1099511627776|g|#region:us-west-1
  </code></pre>
  
  <p>But I am unable to match it against - </p>
  
  <pre><code>datastore.reads:9876|ms
  </code></pre>
  
  <p>Any help?</p>
  
  <p>RegEx 101 to try - <a href="https://regex101.com/r/H8vQTa/1/" rel="nofollow noreferrer">https://regex101.com/r/H8vQTa/1/</a></p>