uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.
Product:
Class:
Gets a special Rule object used to define global, cumulative properties that apply across all rules in a transformation pass.
Note: This feature is currently in the design phase and is not yet implemented in the production engine.
The GlobalRuleSet property provides access to a special Rule object that is not used for matching text itself. Instead, it acts as a central control panel for setting properties that have a cumulative effect on the entire Transformer operation. This is a powerful feature for establishing global constraints and validation logic.
It is crucial to understand the different scopes of rule configuration:
| Configuration Method | Scope & Purpose |
|---|---|
Per-Rule (myRule.@StopAfter(5)) | Individual. Affects only myRule. Each rule has its own independent counter and settings. |
| DefaultRuleSet | Template. Sets the initial property values for all new rules created in the transformer. Each rule still behaves independently. |
GlobalRuleSet (This Property) | Global/Cumulative. Sets a shared, single limit for the entire transformer pass. The counter is shared across all rules. |
When set on the GlobalRuleSet, these properties have a cumulative effect:
@StopAfter(n): The entire transformation pass stops after a combined total of n matches have been found across all active rules.@StartAfter(n): The transformation will skip the first n total matches found across all rules before it begins keeping results.@Maximum(n): The entire transformation pass is invalidated (returning zero matches) if the combined total of matches from all rules exceeds n.@Minimum(n): The entire transformation pass is invalidated if the combined total of matches from all rules is less than n.To enable the "all or nothing" validation behavior of global Minimum and Maximum properties, the Transformer may need to store a backup of the original string. If a global constraint is not met, the engine discards all results. This can consume more memory than a standard transformation.
In a standard Regex-based workflow, enforcing a global match count is a manual, multi-step process:
if statement in your host language (C#, C++, etc.) to check if the total count meets your constraints.This is imperative, verbose, and inefficient. uCalc's GlobalRuleSet is declarative. You state your constraints directly on the Transformer, and the engine handles the complex validation and counting logic internally. This leads to cleaner, more expressive, and less error-prone code by keeping the validation logic tightly coupled with the transformation it governs.