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.

Ignoring Content with SkipOver

Product: 

Class: 

Learn how to define patterns that exclude specific text, like comments, from being processed by other transformation rules.

Remarks

🛡️ Protecting Text: Ignoring Content with SkipOver

Sometimes, the most important part of a transformation is knowing what not to transform. The SkipOver method is uCalc's primary tool for creating "dead zones" or "no-fly zones" within your text. Any content that matches a SkipOver pattern is completely ignored by all other find-and-replace rules, making it essential for protecting content like code comments, string literals, or raw data blocks.

⚙️ How It Works: Highest Precedence

The most critical concept to understand about SkipOver is its precedence. SkipOver rules are always evaluated before any FromTo or Pattern rules, regardless of their definition order. If a piece of text matches a SkipOver pattern, it is immediately excluded from further processing for that pass.

This creates a powerful safety net. You can define a rule to skip over all comments, and you are guaranteed that no other rule will accidentally modify text inside those comments.

SkipOver vs. FromTo("pattern", "{@Self}")

While a rule like t.FromTo("/* ... */", "{@Self}") might seem to have the same effect, it behaves very differently in two key ways:

FeatureSkipOver("/* ... */")FromTo("/* ... */", "{@Self}")
Precedence🟢 Highest. Always runs before other rules.🟡 Standard. Competes with other rules based on LIFO order.
Match Results🟢 Invisible. The match is not recorded in the Matches collection.🔴 Visible. A Match object is created and added to the results.

Conclusion: Use SkipOver when you want to make text completely invisible to the transformation engine. Use FromTo when you need to find text and keep it, but still want it to be part of the official match results.

💡 Why uCalc? (Comparative Analysis)

In standard regular expressions, achieving this "skip" behavior is complex and often error-prone. It typically requires negative lookarounds ((?<!...) and (?!...)) or a multi-pass approach where you first remove the content to be ignored, perform replacements, and then add it back.

The uCalc Advantage is its declarative and integrated nature. SkipOver is a simple, readable instruction that clearly states your intent. The engine handles the complex logic of prioritizing and excluding text internally, leading to rules that are safer, easier to write, and more maintainable.

Examples

A basic example demonstrating how to ignore a block of text in parentheses, preventing other rules from matching inside it.
				
					using uCalcSoftware;

var uc = new uCalc();
var t = new uCalc.Transformer();
t.FromTo("word", "WORD"); // Rule to uppercase 'word'
t.SkipOver("({ignore})"); // Rule to ignore content in parentheses

var text = "transform this word, but (not this word)";
Console.WriteLine(t.Transform(text));
				
			
transform this WORD, but (not this word)
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;
   t.FromTo("word", "WORD"); // Rule to uppercase 'word'
   t.SkipOver("({ignore})"); // Rule to ignore content in parentheses

   auto text = "transform this word, but (not this word)";
   cout << t.Transform(text) << endl;
}
				
			
transform this WORD, but (not this word)
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      Dim t As New uCalc.Transformer()
      t.FromTo("word", "WORD") '// Rule to uppercase 'word'
      t.SkipOver("({ignore})") '// Rule to ignore content in parentheses
      
      Dim text = "transform this word, but (not this word)"
      Console.WriteLine(t.Transform(text))
   End Sub
End Module
				
			
transform this WORD, but (not this word)