title: splunk - Get a distinct count of field values matching a regex
body: <p>I am doing this -</p>
  
  <pre><code>&lt;&lt;&gt;&gt; | search $country$ $campaign_name$ event_name=email OR event_name=event|stats dc(person_id)
  </code></pre>
  
  <p>Now in last instead of dc of person_id i need a count of person_id which matches a regex -</p>
  
  <pre><code>&lt;&lt;&gt;&gt; | search $country$ $campaign_name$ event_name=email OR event_name=event|stats dc(regex person_id="^(.?$|[^W].+|W[^F].*)" )
  </code></pre>
  
  <p>I tried above query using regex in dc() but it breaks. Any help would be greatly appreciated.</p>