using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();
var txt = "<p id='aa'>xyz</p><p id='bb'>Hello</p ><p id='cc'>World</p>";
t.Text = txt;

// Parent rule matches the <p> tag. Its local transformer then extracts the 'id' attribute.
var parentRule = t.Pattern("<p {etc}>");
parentRule.LocalTransformer.FromTo("id={@string:id}", "{id}");
t.Filter();

Console.WriteLine("--- All Matches (Parent and Child) ---");
Console.WriteLine(t.GetMatches(MatchesOption.All).Text);
Console.WriteLine("");

Console.WriteLine("--- RootLevelOnly (Parent Matches) ---");
Console.WriteLine(t.GetMatches(MatchesOption.RootLevelOnly).Text);
Console.WriteLine("");

Console.WriteLine("--- InnermostOnly (Child Matches) ---");
Console.WriteLine(t.GetMatches(MatchesOption.InnermostOnly).Text);