title: Extract substring from character A to character B or EOL using Regexp_extract of Big Query / Google Analytics
body: <p>I'm working with Google Big Query and try to extract some information from a string column into another column using Regexp_extract. In short:</p>
  
  <p>Data in <em>myVariable</em>:</p>
  
  <pre><code>yippie/eggs-spam/?portlet:hungry=1234
  yippie/eggs-spam/?portlet:hungry=456&amp;portlet:hungrier=7890
  </code></pre>
  
  <p>I want a column with:</p>
  
  <pre><code>1234
  456
  </code></pre>
  
  <p>My command:</p>
  
  <pre><code>SELECT Regexp_extract(myVariable, r'SOME_MAGIC') as result
  FROM table
  </code></pre>
  
  <p>I tried for SOME_MAGIC:</p>
  
  <pre><code>hungry=(.*)[&amp;$] - null, 456 (I learned that $ is interpreted as is)
  hungry=(.*)(&amp;|$) - Error: Exactly one capturing group must be specified
  hungry=(.*)^&amp; - null, null
  hungry=(&amp;.*)?$ - null, null
  </code></pre>
  
  <p>I read <a href="https://stackoverflow.com/questions/30333484/extracting-data-using-regexp-extract-in-google-bigquery">this</a>, but there the number has a fixed length. Also looked at <a href="https://stackoverflow.com/questions/26737128/regex-to-terminate-on-character-or-end-of-line">this</a>, but "?=" is no known command for perl.</p>
  
  <p>Does anybody have an idea? Thank you in advance!</p>