uCalc API Version: 2.1.3-preview.2 Released: 6/16/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.

Introduction

Product: 

Class: 

Remarks

Variable Postfix Modifiers: Introduction

Description: An overview of the symbols appended to pattern variables to override default capture logic, ignore structural boundaries, or force immediate transformations.

While Directives (starting with {@) define structural engine commands, Variable Postfix Modifiers are specific symbols used within pattern variables (like {x}) to qualify how text is matched.

By default, uCalc is structurally aware: it respects bracket levels and treats quoted strings as atomic units. Postfix modifiers allow you to override these safe defaults when a specific transformation requires more "raw" or "aggressive" text handling.

Core Modifiers and Overrides

  • Nesting Override (^): By default, uCalc respects balanced brackets (nesting). Use ^ to ignore balance levels, allowing the capture to stop at a terminal character even if it is inside a nested structure.
  • Quote Override (`): By default, quoted strings are atomic and cannot be split. Use the backtick to ignore quote boundaries, allowing the capture to break or include partial contents of a quoted string.
  • Separator Override (+): Instructs the engine to ignore standard statement separators (like ; or specific line breaks) that would otherwise terminate a variable capture.
  • Verbatim Capture (~): Captures the text exactly as it appears and prevents the engine from scanning for nested matches inside the captured block. This ensures the content remains "opaque" to other rules.
  • Immediate Transform (%): The opposite of verbatim; it forces the engine to immediately search for and execute nested transformation rules within the captured text before finalizing the outer match.
  • Whitespace Retention: Determines whether the leading/trailing whitespace found around a token is included in the variable's final string value.
  • Boundary Extension: A proposed modifier (Topic 783) for extending the reach of a variable match beyond standard termination points.

Combining Modifiers

Multiple postfix modifiers can be combined within a single variable definition if their logic does not conflict. For example, {content^~} would capture a block of text while ignoring bracket levels and preventing internal nested matches.

Examples

Ignore quote directive `
				
					using uCalcSoftware;

var uc = new uCalc();
var t = uc.NewTransformer();

t.FromTo("a {txt} c", "<{@Self}>"); // Quoted text treated as 1 token
t.FromTo("x {txt`} z", "<{@Self}>"); // Quotes treated as ordinary chars

Console.WriteLine(t.Transform("a 'b c' b c :: x 'y z' y z"));
				
			
<a 'b c' b c> :: <x 'y z>' y z
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();

   t.FromTo("a {txt} c", "<{@Self}>"); // Quoted text treated as 1 token
   t.FromTo("x {txt`} z", "<{@Self}>"); // Quotes treated as ordinary chars

   cout << t.Transform("a 'b c' b c :: x 'y z' y z") << endl;
}
				
			
<a 'b c' b c> :: <x 'y z>' y z
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t = uc.NewTransformer()
      
      t.FromTo("a {txt} c", "<{@Self}>") '// Quoted text treated as 1 token
      t.FromTo("x {txt`} z", "<{@Self}>") '// Quotes treated as ordinary chars
      
      Console.WriteLine(t.Transform("a 'b c' b c :: x 'y z' y z"))
   End Sub
End Module
				
			
<a 'b c' b c> :: <x 'y z>' y z