Advertisement
Lulunga

06. Extract Emails regex

Jul 26th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(arr) {
  2.  
  3.     arr.forEach(line => {
  4.  
  5.         let result = line.match(/(?<=\s)([a-z]+|\d+)(\d+|\w+|\.+|-+)([a-z]+|\d+)\@[a-z]+\-?[a-z]+\.[a-z]+(\.[a-z]+)?/gm);
  6.  
  7.         if (result) {
  8.             console.log(result.join('\n'));
  9.         }
  10.  
  11.  
  12.     });
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement