using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\""(?<Event_Log>[^\""]+)\""";
string input = @"2021-12-04T01:29:48.015524+00:00 USHCO-EXXON, ipsec-ike-down, 689, ""IKE connection with peer 10.218.42.113 (routing-instance EXXON-Control-VR) is up"", USPAB
2021-12-04T01:29:15.007722+00:00 USHCO-EXXON, ipsec-tunnel-down, 687, ""IPSEC tunnel with peer 10.218.42.111 (routing-instance EXXON-Control-VR) is up"", USPAB
2021-12-04T01:29:15.007722+00:00 USHCO-EXXON, ipsec-ike-down, 686, ""IKE connection with peer 10.218.42.111 (routing-instance EXXON-Control-VR) is up"", USPAB
2021-12-04T01:29:14.807814+00:00 USHCO-EXXON, ipsec-tunnel-down, 872, ""IPSEC tunnel with peer 10.218.42.111 (routing-instance EXXON-Control-VR) is up"", USPAB
2021-12-04T01:29:14.807814+00:00 USHCO-EXXON, ipsec-ike-down, 871, ""IKE connection with peer 10.218.42.111 (routing-instance EXXON-Control-VR) is up"", USPAB";
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