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.

{@dq}

Product: 

Class: 

Remarks

Description: A shortcut directive that matches the double-quote character " (specifically the _Token_QuoteChar_Double token).

The {@dq} directive is used within a uCalc::Transformer as a specialized matcher for the double-quote character. Conceptually, it functions similarly to {@Bracket} (Topic 803), serving as a structural anchor rather than a content matcher.

Structural Role

Unlike {@String}—which captures an entire quoted string—{@dq} matches only the quote character itself. This is useful when you need to redefine the boundaries of a string or perform transformations that affect the delimiters specifically.

  • Internal Shortcut: This is equivalent to calling {@Token(_Token_QuoteChar_Double)}.
  • Delimiter vs. Data: Use {@dq} to match the quote; use {@String} or {@StringDQ} to match the enclosed text.

Inverse Matching with !

The inversion operator ! can be applied to this directive:

  • {@dq}: Matches the double-quote character.
  • {!dq}: Matches any token that is not a double-quote character.

Examples

Replacing double quotes with single quotes.

ID: 920

See: {@dq}
				
					using uCalcSoftware;

var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("{@dq}", "'");

Console.WriteLine(t.Transform("""
print "Hello"
"""));
				
			
print 'Hello'
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;
   t.FromTo("{@dq}", "'");

   cout << t.Transform(R"(print "Hello")") << endl;
}
				
			
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("{@dq}", "'")
      
      Console.WriteLine(t.Transform("print ""Hello"""))
   End Sub
End Module
				
			
print 'Hello'
(Real World: Escaping Helper) Finding double quotes to manually insert an escape backslash before them.

ID: 921

				
					using uCalcSoftware;

var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("{@dq}", """
\"
""");

string input = """
He said "Hello"
""";
Console.WriteLine(t.Transform(input));
				
			
He said \"Hello\"
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;
   t.FromTo("{@dq}", R"(\")");

   string input = R"(He said "Hello")";
   cout << t.Transform(input) << endl;
}
				
			
He said \"Hello\"
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t As New uCalc.Transformer()
      t.FromTo("{@dq}", "\""")
      
      Dim input As String = "He said ""Hello"""
      Console.WriteLine(t.Transform(input))
   End Sub
End Module
				
			
He said \"Hello\"