using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"auth-sender:\h+(.+)\h*\R*";
string input = @" 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>";
RegexOptions options = RegexOptions.CultureInvariant;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
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 C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx