title: Ruby Regex: Exclude aclk from google url
body: <p>I have two URLs (actually more because Google has Maps, News, Images etc.)
  Google Organic search:</p>
  
  <pre><code>http://www.google.nl/#hl=nl&amp;biw=1920&amp;bih=965&amp;q=koffie&amp;aq=f&amp;aqi=g10&amp;aql=&amp;oq=&amp;
  fp=b8a3028139d33c34`
  </code></pre>
  
  <p>and Google Adwords search:</p>
  
  <pre><code>http://www.google.nl/aclk?sa=L&amp;ai=CZYun1fI3TY_hO8aMOrer6aQCmK2m2AGIpdyCFr_g_-RVE
  AEoCFDytZmR-_____8BYJGkmoWEGMgBAakCkm-p2E6Ttj6qBBlP0O_GI1GZU09CYDd728FmO_QIDea76u
  yT&amp;num=1&amp;sig=AGiWqtzxvt17KyOWqEkwJ7jVdanxR645tw&amp;
  adurl=http://ad-emea.doubleclick.net/clk%3B233218340%3B57152064%3Bv
  </code></pre>
  
  <p>I need a regex to find <code>google</code> in a URL and exclude the <code>aclk?</code> part. This is only used by Google Adwords. The regex will be used to filter from the host referrer and find only Google Organic traffic.</p>
  
  <p>First I tried this regex:</p>
  
  <pre><code>www[.]google[.].{1,}client=|www[.]google[.].{1,}gs_rfai|www[.]google[.].{1,}&amp;
  prmd|news[.]google[.].{1,}nwshp?| video[.]google|www[.]google[.].{1,} imghp?|
  www[.]google[.].{1,}imgres|www[.]google[.].{1,}search
  </code></pre>
  
  <p>This caught 50% of the traffic. At that time we didn't have Adwords running, so it could've caught all traffic. But it didn't.</p>
  
  <p>We want to catch all Google (organic) URLs and exclude Adwords URLs (with the aclk? ).</p>