title: Exclude Values with Regex - BigQuery
body: <p>What would I use in standard SQL if I wanted to exclude regex matches in a field from being aggregated. The code runs; however it is <strong>counting the values I have in the regex and I want it to exclude instead</strong>. I have this code:</p>
  
  <pre><code>SELECT
      channelGrouping, 
      date,
      SUM(totals.timeOnSite) AS Session_Duration,
      SUM(totals.visits) AS Visits,
      AVG(totals.timeonSite/totals.visits) AS Avg_Time_per_Session,
      SUM(totals.bounces) AS Bounce,
      (SUM(totals.bounces)/SUM(totals.visits)) AS Bounce_rate
  FROM
      `93868086.ga_sessions_*`
  WHERE
      _TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 365 DAY))
  AND
      FORMAT_DATE('%Y%m%d',DATE_SUB(CURRENT_DATE(), INTERVAL 1 DAY))
  GROUP BY 
      date,
      channelGrouping,
      geoNetwork.networkLocation 
  HAVING
      REGEXP_CONTAINS(geoNetwork.networkLocation,
      r"^(ovh \(nwk\)|hostwinds llc.|bhost inc|prisma networks llc|psychz networks|buyvm services|private customer|secure dragon llc.|vmpanel|netaction telecom srl-d|hostigation|frontlayer technologies inc.|digital energy technologies limited|owned-networks|rica web services|netaction telecom srl-d|hurricane electric inc.|private customer - host.howpick.com|ssdvirt|sway broadband|detect network|gorillaservers inc.|micfo llc.| netaction telecom srl|egihosting|zenlayer inc|intercom online inc.|gs1 argentine|ovh hosting inc.|vps cheap inc.|limeip networks|blackhost ltd.|amazon.com inc.)$")
  ORDER BY
      date ASC
  </code></pre>