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.
Description: A replacement-only keyword used to reference a specific captured token or sub-part of a match by its numerical index.
The {@Param:n} directive is used within the replacement string of a uCalc::Transformer rule. It allows you to access individual components of a match based on their order of appearance in the pattern.
{@Param:0} refers to the first token or group matched by the pattern, {@Param:1} to the second, and so on.{@Alpha:var}) are often preferred for clarity, {@Param} is invaluable when dealing with anonymous tokens or when the pattern consists of a sequence of similar tokens that need to be reordered.One of the most powerful uses of {@Param} is for "shuffling" text. Because the replacement string can place these parameters in any order, you can easily swap the positions of words, move prefixes to suffixes, or duplicate parts of a match.
{@Self}: Returns the entire text segment matched by the pattern as a single unit.{@Param:n}: Returns only the specific nth part of that segment.Note: If a pattern uses recursion or complex grouping, the index corresponds to the flat sequence of tokens as they were validated by the engine.
Identifying two consecutive words and reversing their order in the output.
New(uCalc::Transformer, t)// Match two words separated by a spacet.FromTo("{@Alpha} {@Alpha}", "{@Param:1} {@Param:0}")wl(t.Transform("Hello World"))[Expected Output]World Hello
Converting a date from a slash-separated format (MM/DD/YYYY) to a standardized ISO format (YYYY-MM-DD).
New(uCalc::Transformer, t)// Pattern matches: Month (0) / (1) Day (2) / (3) Year (4)t.FromTo("{@Number} / {@Number} / {@Number}", "{@Param:4}-{@Param:0}-{@Param:2}")wl(t.Transform("01/15/2026"))[Expected Output]2026-01-15
Verifying that {@Param} can extract specific tokens from a mixed sequence while ignoring the delimiters in the final output.
New(uCalc::Transformer, t)// Pattern: Alpha (0) , (1) Number (2) ; (3)t.FromTo("{@Alpha} , {@Number} ;", "ID:{@Param:2} NAME:{@Param:0}")wl(t.Transform("User, 101;"))[Expected Output]ID:101 NAME:User
{@Param:4} can become hard to track. In those cases, switching to named variables (e.g., {@Number:year}) is recommended for better code maintenance.{@ws}), that whitespace occupies an index. If you forget to account for it, your {@Param} indices will be off by one.\1, \2), making it a low-friction tool for experienced developers.{@Self} and {@Doc}.ID: 208
using uCalcSoftware;
var uc = new uCalc();
var t = uc.NewTransformer();
t.FromTo("This {etc} big test {words:2}",
"{@Param:0}:{@Param:1}:{@Param:1+1}:{@Param:2+1}:{@Param:2*2}");
Console.WriteLine(t.Transform("This is a big test we have today"));
This:is a:big:test:we have today using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); t.FromTo("This {etc} big test {words:2}", "{@Param:0}:{@Param:1}:{@Param:1+1}:{@Param:2+1}:{@Param:2*2}"); Console.WriteLine(t.Transform("This is a big test we have today"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto t = uc.NewTransformer();
t.FromTo("This {etc} big test {words:2}",
"{@Param:0}:{@Param:1}:{@Param:1+1}:{@Param:2+1}:{@Param:2*2}");
cout << t.Transform("This is a big test we have today") << endl;
}
This:is a:big:test:we have today #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); t.FromTo("This {etc} big test {words:2}", "{@Param:0}:{@Param:1}:{@Param:1+1}:{@Param:2+1}:{@Param:2*2}"); cout << t.Transform("This is a big test we have today") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t = uc.NewTransformer()
t.FromTo("This {etc} big test {words:2}",
"{@Param:0}:{@Param:1}:{@Param:1+1}:{@Param:2+1}:{@Param:2*2}")
Console.WriteLine(t.Transform("This is a big test we have today"))
End Sub
End Module
This:is a:big:test:we have today Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t = uc.NewTransformer() t.FromTo("This {etc} big test {words:2}", "{@Param:0}:{@Param:1}:{@Param:1+1}:{@Param:2+1}:{@Param:2*2}") Console.WriteLine(t.Transform("This is a big test we have today")) End Sub End Module