Practical: Iterates through all matches and uses the `Match.Rule` property to identify which pattern generated each match, demonstrating a key introspection feature.

ID: 1100

				
					using uCalcSoftware;

var uc = new uCalc();
var t = new uCalc.Transformer();
var logText = "INFO: System start. WARN: Low disk. ERROR: DB connection failed.";
t.Text = logText;

// Define rules for different log levels
var errorRule = t.Pattern("ERROR: {msg}.");
var warnRule = t.Pattern("WARN: {msg}.");
var infoRule = t.Pattern("INFO: {msg}.");

t.Find();

Console.WriteLine("--- Analysis of All Matches ---");
foreach(var match in t.Matches) {
   // Use the match's Rule property to get the name of the rule that found it
   Console.WriteLine($"Found '{match.Text}' using rule: '{match.Rule.Name}'");
}
				
			
--- Analysis of All Matches ---
Found 'INFO: System start.' using rule: 'info'
Found 'WARN: Low disk.' using rule: 'warn'
Found 'ERROR: DB connection failed.' using rule: 'error'
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;
   auto logText = "INFO: System start. WARN: Low disk. ERROR: DB connection failed.";
   t.Text(logText);

   // Define rules for different log levels
   auto errorRule = t.Pattern("ERROR: {msg}.");
   auto warnRule = t.Pattern("WARN: {msg}.");
   auto infoRule = t.Pattern("INFO: {msg}.");

   t.Find();

   cout << "--- Analysis of All Matches ---" << endl;
   for(auto match : t.Matches()) {
      // Use the match's Rule property to get the name of the rule that found it
      cout << "Found '" << match.Text() << "' using rule: '" << match.Rule().Name() << "'" << endl;
   }
}
				
			
--- Analysis of All Matches ---
Found 'INFO: System start.' using rule: 'info'
Found 'WARN: Low disk.' using rule: 'warn'
Found 'ERROR: DB connection failed.' using rule: 'error'
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t As New uCalc.Transformer()
      Dim logText = "INFO: System start. WARN: Low disk. ERROR: DB connection failed."
      t.Text = logText
      
      '// Define rules for different log levels
      Dim errorRule = t.Pattern("ERROR: {msg}.")
      Dim warnRule = t.Pattern("WARN: {msg}.")
      Dim infoRule = t.Pattern("INFO: {msg}.")
      
      t.Find()
      
      Console.WriteLine("--- Analysis of All Matches ---")
      For Each match In t.Matches
         '// Use the match's Rule property to get the name of the rule that found it
         Console.WriteLine($"Found '{match.Text}' using rule: '{match.Rule.Name}'")
      Next
   End Sub
End Module
				
			
--- Analysis of All Matches ---
Found 'INFO: System start.' using rule: 'info'
Found 'WARN: Low disk.' using rule: 'warn'
Found 'ERROR: DB connection failed.' using rule: 'error'