Hi Folks,
I'm struggling a bit trying to capture some information via regex in my script. If I try the regex and sample data in
regex101.com I get the matches I expect.
I'm capturing the body of each email with:
var text = messages[m].getPlainBody();
and then attempting to match a variety of fields based upon this regex:
var matches = text.match(/From:.*\<(.*)\>\nSent:.*\nTo:.*\<(.*)\>\nSubject:(.*)/m);
The data stored in text is:
________________________________
From: Support <
sup...@replacedemail.com>
Sent: Friday, June 10, 2022 6:58:00 AM (UTC-05:00) Eastern Time (US & Canada)
To: Hoffman, Harry <
hhof...@anotheremail.com>
Subject: Critical Failed Check: Missing MFA
This email originates from a sender outside of Northeastern University.
[sca logo]
Compliance check failure
Jun 10, 10:58 AM
No MFA Configured
Critical | 17 failing users since 10 Jun 2022 04:21 GMT
<TRUNCATED MESSAGE FOR POSTING>