title: Python - Extract pattern from string using RegEx
body: <p>I have a string in variable <code>a</code> as below:</p>
  
  <pre><code>a = 'foo(123456) together with foo(2468)'
  </code></pre>
  
  <p>I would like to use "re" to extract both <code>foo(123456)</code> and <code>foo(2468)</code> from the string.</p>
  
  <p>I have two questions:</p>
  
  <ol>
  <li>What is the correct regex to be used? <code>foo(.\*)</code> doesn't seem to work, as it treats <code>123456)</code> together with <code>foo(2468</code> as <code>.*</code>  </li>
  <li>How to extract both foo?</li>
  </ol>