using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.Text = "The apple is an apple."; // Overlapping patterns. The longer one is defined last, so it gets precedence. t.Pattern("apple"); t.Pattern("an apple"); Console.WriteLine("--- First Find ---"); t.Find(); // The first 'apple' matches the first rule. // The 'an apple' matches the second (higher precedence) rule. Console.WriteLine(t.Matches.Text); // Re-running find should produce the exact same result Console.WriteLine("--- Second Find (no change) ---"); t.Find(); Console.WriteLine(t.Matches.Text);