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

Title

Bold statement

Title B

Other text

My paragraph

"); // ^ ^ ^ ^ ^ // 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 // 0 10 20 30 40 50 60 70 80 // Carrets (^) point to Start locations of the matches auto AnyOtherTag = t.Pattern("<{tag}>{text}"); auto BoldTag = t.Pattern("{text}"); auto H3Tag = t.Pattern("

{text}

"); t.Find(); cout << "IndexOf StartPos Match" << endl; cout << "" << endl; cout << "All Matches" << endl; cout << "-----------" << endl; for(auto match : t.Matches()) { cout << t.Matches().IndexOf(match.StartPosition()) << " " << match.StartPosition() << " " << match.Text() << endl; } cout << "" << endl; cout << "Bold Matches" << endl; cout << "------------" << endl; for(auto BoldMatch : BoldTag.Matches()) { cout << t.Matches().IndexOf(BoldMatch.StartPosition()) << " " << BoldMatch.StartPosition() << " " << BoldMatch.Text() << endl; } cout << "" << endl; cout << "H3 Matches" << endl; cout << "----------" << endl; for(auto H3Match : H3Tag.Matches()) { cout << t.Matches().IndexOf(H3Match.StartPosition()) << " " << H3Match.StartPosition() << " " << H3Match.Text() << endl; } cout << "" << endl; cout << "Other Matches" << endl; cout << "-------------" << endl; for(auto AnyOtherMatch : AnyOtherTag.Matches()) { cout << t.Matches().IndexOf(AnyOtherMatch.StartPosition()) << " " << AnyOtherMatch.StartPosition() << " " << AnyOtherMatch.Text() << endl; } }