title: JavaScript split string around emails
body: <p>So I have this list of emails:</p>
  
  <pre><code>john.doe@doe.com
  john.doe@doe.com
  john.doe@doe.com
  john.doe@doe.com
  john.doe@doe.com
  john.doe@doe.com
  john.doe@doe.com
  john.doe@doe.com
  </code></pre>
  
  <p>It comes through as a string, sometimes with a return character at the end of each line, sometimes it doesn't. All I want to be able to do is pull out each email from the string using regex.</p>
  
  <p>So I've got this regex exp from <a href="https://stackoverflow.com/questions/46155/validate-email-address-in-javascript">here</a>:</p>
  
  <pre><code>function validateEmail(email) { 
      var re = /^(([^&lt;&gt;()[\]\\.,;:\s@\"]+(\.[^&lt;&gt;()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
      return re.test(email);
  } 
  </code></pre>
  
  <p>How do I get it to match many email addresses and return me each individual email?</p>
  
  <p><strong>I do not</strong> want to split on a return character, I can't always garauntee that it will be that character that will split the list up. These emails are pasted in from the users clipboard. If it were that easy, I wouldn't have asked ;)</p>