title: A function that returns email addresses from a list of strings in Python
body: <p>I need to create a function which returns email addresses from a list of strings. I have done this successfully with the following code:</p>
  
  <pre><code>def myfunction(bigstring):
      str = ' '.join(bigstring)
      my_string = str
      str1 = re.findall(r'[\w\.-]+@[\w\.-]+', my_string)
      return str1
  </code></pre>
  
  <p>However when I run the following sample:</p>
  
  <pre><code>emails = ['John Kennedy &lt;jk123@gmail.com&gt; or &lt;johnk123@hotmail.com&gt;','Adam Hartley &lt;ah123@yahoo.com&gt;','Ben Saunders &lt;benji@live.co.uk&gt;']
  myfunction(emails)
  </code></pre>
  
  <p>I get the output:</p>
  
  <pre><code>['jk123@gmail.com', 'johnk123@hotmail.com', 'ah123@yahoo.com', 'benji@live.co.uk']
  </code></pre>
  
  <p>However i would like the following output, but I am not sure how to do so without messing up my code:</p>
  
  <pre><code>[['jk123@gmail.com', johnk123@hotmail.com'], ['ah123@yahoo.com'], ['benji@live.co.uk']]
  </code></pre>
  
  <p>I need to return a list within a list as shown by the desired output.</p>