using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(\(loggingInfo\)|\(beneLoggingInfo\)) - (?<vendorinfo>[^|]*)\|(?<login>[^|]*)\|(?<action>[^|]*)\|(?<timeStamp>[^\|]*)\|(?<tag2>[^\|]*)\|(?<tag6>[^\|]*)\|(?<tag7>[^\|]*)\|(?<tag8>[^\|]*)\|(?<tag9>[^\|]*)\|(?<tag10>[^\|]*)\|(?<tag11>[^\|]*)\|";
string input = @"18 Jul 2018 09:05:31,068 INFO (loggingInfo) - Auto CRM|ppope|ApplicationLogin|Wed Jul 18 09:05:31 CDT 2018|CSR agent successfully logged in||Successful||||NA|
22 Oct 2018 08:36:41,164 INFO (beneLoggingInfo) - Beneficiary Administration|TESTWHBENE|APPLICATION LOGIN|Mon Oct 22 08:36:41 CDT 2018|User successfully logged in for Client = 070||SUCCESSFUL||||NA|
22 Oct 2018 00:43:23,845 INFO (loggingInfo) - Inquiry Application|TUSER4444|APPLICATION LOGIN|Mon Oct 22 00:43:23 CDT 2018|User successfully logged in for Client : 580||SUCCESSFUL||||NA|
01 Oct 2018 09:29:33,508 INFO (loggingInfo) - ISIS PersonalPlan|TESTOMAR|APPLICATION LOGIN|Mon Oct 01 09:29:33 CDT 2018|User successfully logged in for Client : 002||SUCCESSFUL||||NA|
24 Oct 2018 13:46:07,647 INFO (loggingInfo) - Web-Billing|egunderson| User Authentication|10/24/2018 01:46:07 PM| User Authentication|NA|True| NA| NA| NA| NA|
";
RegexOptions options = RegexOptions.Multiline;
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