using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(?:[-:+ ]*|\d\d/\d\d/\d\d \d\d:\d\d:\d\d INFO acceleratorGenerator: )Filter\s*(\(.+\)).*\[pid: [-\d]+, id: \d+, (?:inner: \S+, )?sid: [-\d]+\](?::\s+\{StructType\(((?:\s+StructField\(\S+, \S+, [^)]+\),?)+)\)\})?";
string input = @" +- Filter (((isnotnull(d_year#143) && (d_year#143 >= 1999)) && (d_year#143 <= 2001)) && isnotnull(d_date_sk#137)) [pid: 582, id: 583, sid: 67]
+- Filter(isnotnull(year_total # 875) && (year_total#875 > 0.0)) [pid: 26, id: 27, sid: 1]
+- Filter(((isnotnull(d_date_sk#137) && isnotnull(d_week_seq#141)) && (d_week_seq#141 = Subquery subquery877))) [pid: 159, id: 160, inner: false, sid: 16]: {StructType( StructField(d_date_sk, integer, false), StructField(d_week_seq, integer, false))}";
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