using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
var document = """

Header: Section 1
Data: A
Data: B
Header: Section 2
Data: C

""";
t.Text = document;

var dataRule = t.Pattern("Data: {val}");
var headerRule = t.Pattern("Header: {val}");

dataRule.Minimum = 2;
Console.WriteLine("--- Find with Minimum(2) ---");
t.Find();
Console.WriteLine($"Total Matches: {t.Matches.Count()}");
Console.WriteLine($"Data Matches: {dataRule.Matches.Count()}");
Console.WriteLine($"Header Matches: {headerRule.Matches.Count()}");

dataRule.Minimum = 4;
Console.WriteLine("");
Console.WriteLine("--- Find with Minimum(4) ---");
t.Find();
Console.WriteLine($"Total Matches: {t.Matches.Count()}");
Console.WriteLine($"Data Matches: {dataRule.Matches.Count()}");
Console.WriteLine($"Header Matches: {headerRule.Matches.Count()}");