#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; // Pattern: Match "Log:", an optional level, and the message. // Replacement: Use `{!level:INFO}` to insert 'INFO' if {level} is empty. t.FromTo("Log: [{level: ERROR | WARN}] {msg}", "Status:{!level:INFO}{level} | Msg:{msg}"); // Case 1: Level is present cout << t.Transform("Log: ERROR File not found") << endl; // Case 2: Level is missing, so the fallback is used cout << t.Transform("Log: System started successfully") << endl; }