using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"((?P<email_subject>(?<=,)[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+(?=\s*(?:\w+=|,))))";
string input = @"2017-11-30T17:00:02.596Z,10.1.20.211,RenjuXXX,X.X.X.X,mxa-0003fe01.xx.renjj.com,;250 2.0.0 2ej1k6mass-1 Message accepted for delivery;ClientSubmitTime:,Outbound to Internet,SMTP,SEND,asadasdasd1212,<DM2PR0801MB07631A46D877CA83645A2407A5380@Renju.asdasd.prod.outlook.com>,b4b8c0b5-ce3b-4aca-8335-08d53813c96a,Jose.SantanaJr@baycare.org,250 2.1.5 Recipient ok,41758,1,,,RE: my CV,rsola@cmh.edu,rsola@cmh.edu,";
foreach (Match m in Regex.Matches(input, pattern))
{
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