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 shortcut directive that matches the single-quote character ' (specifically the _Token_QuoteChar_Single token).
The {@sq} directive is used within a uCalc::Transformer as a specialized matcher for the single-quote character. It functions as a structural anchor, allowing you to target the delimiter itself rather than the string content.
Like {@dq} (Topic 827), this directive matches only the single-character delimiter. It is essential for patterns where you need to manipulate the "wrapper" of a literal without necessarily affecting the data inside.
{@Token(_Token_QuoteChar_Single)}.{@sq} to match the quote mark; use {@sqs} (Topic 832) to match a complete single-quoted string literal. Use {@QuoteChar} to match either the single or double quote character.!The universal inversion operator ! applies to this directive:
{@sq}: Matches the single-quote character.{!sq}: Matches any token that is not a single-quote character.ID: 888
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("{@sq}", """
"
""");
Console.WriteLine(t.Transform("print 'Hello'"));
print "Hello" using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.FromTo("{@sq}", """ " """); Console.WriteLine(t.Transform("print 'Hello'"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
t.FromTo("{@sq}", R"(")");
cout << t.Transform("print 'Hello'") << endl;
}
print "Hello" #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; t.FromTo("{@sq}", R"(")"); cout << t.Transform("print 'Hello'") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
t.FromTo("{@sq}", """")
Console.WriteLine(t.Transform("print 'Hello'"))
End Sub
End Module
print "Hello" Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() t.FromTo("{@sq}", """") Console.WriteLine(t.Transform("print 'Hello'")) End Sub End Module
ID: 901
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("{@sq}", "''");
string input = "It's a trap";
Console.WriteLine(t.Transform(input));
It''s a trap using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.FromTo("{@sq}", "''"); string input = "It's a trap"; Console.WriteLine(t.Transform(input));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
t.FromTo("{@sq}", "''");
string input = "It's a trap";
cout << t.Transform(input) << endl;
}
It''s a trap #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; t.FromTo("{@sq}", "''"); string input = "It's a trap"; cout << t.Transform(input) << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
t.FromTo("{@sq}", "''")
Dim input As String = "It's a trap"
Console.WriteLine(t.Transform(input))
End Sub
End Module
It''s a trap Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() t.FromTo("{@sq}", "''") Dim input As String = "It's a trap" Console.WriteLine(t.Transform(input)) End Sub End Module
ID: 902
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("{@sq}", "$");
// Only the single quote should be replaced
Console.WriteLine(t.Transform("""
"Hello" and 'World'
"""));
"Hello" and $World$ using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.FromTo("{@sq}", "$"); // Only the single quote should be replaced Console.WriteLine(t.Transform(""" "Hello" and 'World' """));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
t.FromTo("{@sq}", "$");
// Only the single quote should be replaced
cout << t.Transform(R"("Hello" and 'World')") << endl;
}
"Hello" and $World$ #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; t.FromTo("{@sq}", "$"); // Only the single quote should be replaced cout << t.Transform(R"("Hello" and 'World')") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
t.FromTo("{@sq}", "$")
'// Only the single quote should be replaced
Console.WriteLine(t.Transform("""Hello"" and 'World'"))
End Sub
End Module
"Hello" and $World$ Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() t.FromTo("{@sq}", "$") '// Only the single quote should be replaced Console.WriteLine(t.Transform("""Hello"" and 'World'")) End Sub End Module