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.
{@QuoteChar}
Product:
Class:
Remarks
Description: A category matcher that identifies any token defined as a string delimiter, covering both single (') and double (") quotes.
The {@QuoteChar} directive serves as a structural matcher within a uCalc::Transformer. It targets the characters used to open or close string literals. By using this category matcher instead of specific quote directives, you can write rules that apply to all supported string delimiter styles simultaneously.
The Delimiter Category
By default, {@QuoteChar} matches:
- Double Quotes:
"(See{@dq}, Topic 827) - Single Quotes:
'(See{@sq}, Topic 828)
Using {@QuoteChar} is ideal when you want to treat all types of quoted strings with the same structural logic, such as swapping delimiters or identifying the boundaries of literal data without knowing which specific quote style the input uses.
Inverse Matching with !
The universal inversion operator ! can be applied to this category:
{@QuoteChar}: Matches any quote character.{!QuoteChar}: Matches any token that is not a quote character.
Examples
Identifying any quote character and replacing it with a visible tag.
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("{@QuoteChar}", "[Q]");
Console.WriteLine(t.Transform("""
"Double" and 'Single'
"""));
[Q]Double[Q] and [Q]Single[Q] using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.FromTo("{@QuoteChar}", "[Q]"); Console.WriteLine(t.Transform(""" "Double" and 'Single' """));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
t.FromTo("{@QuoteChar}", "[Q]");
cout << t.Transform(R"("Double" and 'Single')") << endl;
}
[Q]Double[Q] and [Q]Single[Q] #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; t.FromTo("{@QuoteChar}", "[Q]"); cout << t.Transform(R"("Double" and 'Single')") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
t.FromTo("{@QuoteChar}", "[Q]")
Console.WriteLine(t.Transform("""Double"" and 'Single'"))
End Sub
End Module
[Q]Double[Q] and [Q]Single[Q] Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() t.FromTo("{@QuoteChar}", "[Q]") Console.WriteLine(t.Transform("""Double"" and 'Single'")) End Sub End Module
(Real World: Quote Normalizer) Converting all string literals to use double quotes, regardless of whether they were originally single or double quoted.
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
// Convert any quote character found to a double quote
t.FromTo("{@QuoteChar}", """
"
""");
string input = """
msg = 'Hello'; val = "World";
""";
Console.WriteLine(t.Transform(input));
msg = "Hello"; val = "World"; using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); // Convert any quote character found to a double quote t.FromTo("{@QuoteChar}", """ " """); string input = """ msg = 'Hello'; val = "World"; """; Console.WriteLine(t.Transform(input));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
// Convert any quote character found to a double quote
t.FromTo("{@QuoteChar}", R"(")");
string input = R"(msg = 'Hello'; val = "World";)";
cout << t.Transform(input) << endl;
}
msg = "Hello"; val = "World"; #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; // Convert any quote character found to a double quote t.FromTo("{@QuoteChar}", R"(")"); string input = R"(msg = 'Hello'; val = "World";)"; 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()
'// Convert any quote character found to a double quote
t.FromTo("{@QuoteChar}", """")
Dim input As String = "msg = 'Hello'; val = ""World"";"
Console.WriteLine(t.Transform(input))
End Sub
End Module
msg = "Hello"; val = "World"; Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() '// Convert any quote character found to a double quote t.FromTo("{@QuoteChar}", """") Dim input As String = "msg = 'Hello'; val = ""World"";" Console.WriteLine(t.Transform(input)) End Sub End Module
(Non-delimiter characters) Verifying that `{@QuoteChar}` does not match characters that are not defined as string delimiters in the engine.
using uCalcSoftware;
var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("{@QuoteChar}", "MATCH");
// Backticks (`) are usually not delimiters by default
Console.WriteLine(t.Transform("`Backtick`"));
`Backtick` using uCalcSoftware; var uc = new uCalc(); var t = new uCalc.Transformer(); t.FromTo("{@QuoteChar}", "MATCH"); // Backticks (`) are usually not delimiters by default Console.WriteLine(t.Transform("`Backtick`"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc::Transformer t;
t.FromTo("{@QuoteChar}", "MATCH");
// Backticks (`) are usually not delimiters by default
cout << t.Transform("`Backtick`") << endl;
}
`Backtick` #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc::Transformer t; t.FromTo("{@QuoteChar}", "MATCH"); // Backticks (`) are usually not delimiters by default cout << t.Transform("`Backtick`") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim t As New uCalc.Transformer()
t.FromTo("{@QuoteChar}", "MATCH")
'// Backticks (`) are usually not delimiters by default
Console.WriteLine(t.Transform("`Backtick`"))
End Sub
End Module
`Backtick` Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim t As New uCalc.Transformer() t.FromTo("{@QuoteChar}", "MATCH") '// Backticks (`) are usually not delimiters by default Console.WriteLine(t.Transform("`Backtick`")) End Sub End Module