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.
In a pattern, the curly brace has special meaning. If you actually want to capture a literal curly brace, and not have it represent a variable or the start of alternative parts, you can either place it within quotes, as in "{", or you can use {@Token(CurlyBrace)}. To capture any bracket (such as { or [, etc) you can use {@Bracket}).
Note: It is much more efficient to use a token category than to define a regex within a pattern. If you need a token with a pattern that's not in the list of tokens in the example, you can define a token with Token.Add, and then refer to it by category in the pattern.
If you do not a rule to interpret commands or token categories, pass it as a string to {@Eval}
Designing robust patterns in uCalc requires a shift from traditional "string-matching" thinking to "structural-parsing" thinking. While uCalc provides powerful regex-like capabilities, its integration with the expression engine allows for more maintainable logic.
The more specific your pattern, the less the engine has to backtrack.
When defining custom patterns or utilizing sub-patterns, use names that reflect the intent of the data, not its format.Instead of Pattern1, use EmailAddress or ProductCode.
By default, some tokens may consume more than intended. Always verify if a "Lazy" match (stopping at the first possible opportunity) is required.
Patterns that call themselves or are nested too deeply can lead to stack overflows or performance degradation. Ensure recursive patterns have a clear "Base Case" or exit condition.
In many parsing scenarios, (space), \t (tab), and \n (newline) are critical. Use {@Whitespace} to explicitly capture these when needed.