Liliana797979

extract emails - fundamentals

Aug 4th, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function extractEmails(text) {
  2.     let pattern = /\s[a-z0-9][a-z0-9\.\-_]+[a-z]@[a-z][a-z\-]+(\.([a-z])+){1,}/g
  3.     let match = pattern.exec(text);
  4.  
  5.     while (match !== null) {
  6.         console.log(match[0])
  7.         match = pattern.exec(text)
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment