title: sed regexp pattern misunderstanding
body: <p>I try to parse log prase by sed:</p>
  
  <pre><code>echo 195.236.222.1 - - [24/Jul/2012:07:35:25 +0300] "GET / HTTP/1.1" 200 387 "http://www.google.fi/url?sa=t&amp;rct=j&amp;q=tarinat&amp;source=web&amp;cd=9&amp;ved=0CGoQFjAI&amp;url=http%3A%2F%2Fwww.suomi24.fi%2F&amp;ei=XyQOUKi0CeWA4gTjz4D4Cg&amp;usg=AFQjCNE6wg5zPXup3d3PRoqU-BtpiNCccw" "Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0.1" |
  sed -r 's/.*(\&amp;q=.*)\&amp;.*/\1/'
  </code></pre>
  
  <p>I would like to get "&amp;q=tarinat" but unfortunately have:</p>
  
  <pre><code>\&amp;q=tarinat&amp;source=web&amp;cd=9&amp;ved=0CGoQFjAI&amp;url=http%3A%2F%2Fwww.suomi24.fi%2F&amp;ei=XyQOUKi0CeWA4gTjz4D4Cg
  </code></pre>
  
  <p>Don't understand the reason why I get the whole string till the end. Any assistance or hints would be highly appreciated.</p>