uCalc API Version: 2.1.3-preview.2 Released: 6/17/2026

Warning

uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.

{@Bracketed}

Product: 

Class: 

Remarks

[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:

  • Parentheses: ( ... )
  • Square Brackets: [ ... ]
  • Curly Braces: { ... }

Why use {@Bracket} instead of Regex?

Standard regular expressions are typically regular (Finite Automata) and cannot handle recursive nesting without complex extensions.

FeatureRegex (.*)uCalc {@Bracket}
Nesting AwarenessMatches 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 DelimitersRequires separate patterns for (), [], and {}.Automatically detects and balances all standard types.
Logic SpeedCan encounter "Catastrophic Backtracking" on deep nests.Linear-time token scanning.

Examples