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.
[revisit]Description: A structural token pattern that matches content enclosed within balanced opening and closing delimiters (parentheses, brackets, or braces).
The {@Bracket} token is a specialized pattern used within a uCalc::Transformer. It is designed to solve the "Nested Delimiter Problem" that often plagues traditional string parsing.
By default, {@Bracket} recognizes:
( ... )[ ... ]{ ... }Standard regular expressions are typically regular (Finite Automata) and cannot handle recursive nesting without complex extensions.
| Feature | Regex (.*) | uCalc {@Bracket} |
|---|---|---|
| Nesting Awareness | Matches to the last closing bracket (greedy) or first (non-greedy), often breaking inner logic. | Tracks nesting levels; only stops when the initial opening bracket is balanced. |
| Mixed Delimiters | Requires separate patterns for (), [], and {}. | Automatically detects and balances all standard types. |
| Logic Speed | Can encounter "Catastrophic Backtracking" on deep nests. | Linear-time token scanning. |