#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); auto txt = "

xyz

Hello

World

"; t.Text(txt); // Parent rule matches the

tag. Its local transformer then extracts the 'id' attribute. auto parentRule = t.Pattern("

"); parentRule.LocalTransformer().FromTo("id={@string:id}", "{id}"); t.Filter(); cout << "--- All Matches (Parent and Child) ---" << endl; cout << t.GetMatches(MatchesOption::All).Text() << endl; cout << "" << endl; cout << "--- RootLevelOnly (Parent Matches) ---" << endl; cout << t.GetMatches(MatchesOption::RootLevelOnly).Text() << endl; cout << "" << endl; cout << "--- InnermostOnly (Child Matches) ---" << endl; cout << t.GetMatches(MatchesOption::InnermostOnly).Text() << endl; }