RegEx - search for emails inside a log file
I'm looking for a regex that will check for matches against a string, for example:
mxtreme1.log: May 12 07:00:00 10.1.1.175 postfix / cleanup [48145]: C2C9FFA730: filename =, sender=LOGINNAME@company.com , from = LOGINNAME @company. com, recip=LOGINNAME@company.com , before =, as_score = 0, as_strategy = M, code = W, actions = FFFFFFFFFFFTFFFFFFFFFF, parsing = F000FFF000TTT000F000TFT000000TTSS3000059900033-F1F-FF00000000F000FFF000000000000F1F-FF00000000F000FFF000000000000
where all in bold is a match, but LOGINNAME can be any number of random characters.
Any help would be greatly appreciated, Thanks,
a source to share
Here's the regex for RFC2822 email addresses .
Surprisingly long, email addresses can be more complex than you might expect.
Just attach it to /sender\s*=\s*/
to receive the sender's email messages.
a source to share