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.
Shortcut: ` (backtick)Associated Method: uCalc.Rule.QuoteAware(bool)
Description: A postfix modifier that allows a pattern variable to ignore the atomic boundaries of quoted strings, enabling it to match content inside or across quotes.
By default, uCalc is "Quote Aware." The lexer identifies quoted strings (e.g., "Hello World") as single, atomic tokens. This prevents transformation rules from accidentally breaking into a string and changing its contents unless explicitly intended.
The Quote Override (`) is used to bypass this protection.
{v} will treat a quoted string as one unit. It cannot capture just the first word inside the quotes because the quotes act as a container.{v`}): Appending the backtick tells the engine that quotes are not atomic for this specific variable. The engine will treat the quote characters as literal delimiters or standard text, allowing the capture to stop or start inside the quoted segment.QuoteAware() MethodYou can toggle this behavior globally using the QuoteAware() method on the uCalc object.
uc.QuoteAware(true): (Default) Quoted strings are treated as unbreakable atomic tokens.uc.QuoteAware(false): All variables behave as if they have the backtick postfix, treating quote characters as standard text.Showing how a standard variable fails to split a quoted string, while the override succeeds.
New(uCalc::Transformer, t)// Default: Tries to match 'say' then any variable. // It will match the WHOLE quoted string as one token.t.FromTo("say {msg}", "MSG:{msg}")// Override: Allows splitting the quoted string.t.FromTo("say \"{msg`}\"", "INSIDE_QUOTE:{msg}")wl(t.Transform("say \"Hello\"")) // Output with ` : INSIDE_QUOTE:HelloUseful when you need to perform a search-and-replace for specific keywords that only appear inside quoted strings.
New(uCalc::Transformer, t)// Capture the content inside double quotes using the overridet.FromTo("\"{content`}\"", "QUOTE_START {content} QUOTE_END")wl(t.Transform("\"Secret Data\""))[Expected Output]QUOTE_START Secret Data QUOTE_END
Verifying that disabling global quote awareness allows all patterns to penetrate quoted strings.
// Disable quote awareness globallyuc.QuoteAware(false)New(uCalc::Transformer, t)// Now the pattern can match 'Word' even if it's inside quotest.FromTo("Word", "MATCH")wl(t.Transform("\"Word\""))[Expected Output]"MATCH"
NestingAware(), the method QuoteAware() clearly defines the engine's stance on structural integrity.ID: 210
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 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"));
#include
#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 #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; }
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 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