JSFiddle - React, Tailwind, and code Playground

by Leniel Maccaferri

HTML

<p id="emails"></p>

JavaScript

var text = '[email protected], "assdsdf" <[email protected]>, "rodnsdfald ferdfnson" <[email protected]>, "Affdmdol Gondfgale" <[email protected]>, "truform techno" <[email protected]>, "NiTsdfeSh ThIdfsKaRe" <[email protected]>, "akasdfsh kasdfstla" <[email protected]>, "Bisdsdfamal Prakaasdsh" <[email protected]>,; "milisdfsfnd ansdfasdfnsftwar" <[email protected]> datum eternus [email protected]';

function extractEmails(text) {
  return text.match(/([a-zA-Z0-9._+-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
}

var emails = extractEmails(text);

$.each(emails, function(index, email) {
  console.log(email);
});