I am using this regex to match email addresses in a string.
Everything works fine here: http://regexr.com?31e5a with this regex:
([\\w-\\.]+)@((?:[\
You pattern is close, you just need to use the global flag and not capture the inner parts of each email acount. I hope it helps.
var re = /(?:[\w-\.]+)@(?:(?:[\w]+\.)+)(?:[a-zA-Z]{2,4})/g;
var emailsString = 'aaaaaaa@bbbb.com xxxxxxx cccccc@ffffdd.com';
var emails = emailsString.match(re); // ["aaaaaaa@bbbb.com", "cccccc@ffffdd.com"]