I have a logic app which is triggered by emails in an inbox. It is all working, except for some emails are getting through when I don't want them. Or rather an email signature with an image description of [email protected] is getting through. I think it might be my regex that is allowing it, but I am not very good with regex.
Here is the code I have so far:
var reg = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi;
var emailData = " \n\n'[email protected]'\n\n \n\n DevOps\n[cid:[email protected]]\n\n ";
//Matching email signatures
var matches = emailData .match(reg);
console.log(matches);
I need the regex to return a list of any email addresses, but they need to be fully formed. Unlike the one mentioned above which is missing the .com (or .org etc).
["[email protected]", "[email protected]"], so what is the problem?[email protected]is not a valid email? maybe no numbers behind the last.or restrict amount of characters after last.?