re = /auth-sender:\h+(.+)\h*\R*/
str = ' Received: from mail pickup service by fakeserver.m2w.com with Microsoft
SMTPSVC; Tue, 3 Dec 2019 14:36:35 -0800
auth-sender: santaana@fakeemail.com
Received: from 217.165.33.125 unverified ([217.165.33.125]) by
mmmeb08oc.m2w.com with M2W SMTP Server;
Tue, 03 Dec 2019 14:36:34 -0800
Date: Wed, 04 Dec 2019 02:32:18 +0400
From: "Coordinador MLV" <santaana@fakeemail.com>
To: <8736c321fd7cc61b92396b4f275614c7@fakeemail.comm>'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html