Assembly: OptimaJet.Workflow.Core

Class RegexPattern

OptimaJet.Workflow.Core.CodeActions.RegexPattern

Defines regular-expression patterns for locating and parsing process parameter placeholders in workflow expressions and substitutable text.

public static class RegexPattern

Fields

public const string Parameter = "(?<FindParameter>(?<MaybeWithBracket>@\\()|(?<WithoutBracket>(?<=[^\\w]|^|\\\\n)@))(?<ParameterName>(?(MaybeWithBracket)[\\w ]+(\\.[\\w ]+)*|\\w+(\\.\\w+)*))((?<MaybeExistsFormat>:(?!\\s*@))|())(?<Format>(?(MaybeExistsFormat)(?(MaybeWithBracket)([^\"'()]|(?<=\\\\)(\\(|\\)|\\\"|'))*|[^\\(\\)\\{\\}\\[\\]\\s\\\"']*)|))(?<EndWithBracketIfExists>(?(MaybeWithBracket)\\)|))" #
Defines a regular-expression pattern that matches process parameter placeholders with optional format specifiers.

Remarks

Example

In '@document.Employee.Amount:format' and "@(document.Employee.Amount:format)", the matches are @document.Employee.Amount:format and @(document.Employee.Amount:format).
public const string ParameterAndMaybeQuotes = "(?:((?<MaybeWithSingleQuote>\\')|())|((?<MaybeWithDoubleQuote>\\\")|()))(?<FindParameter>(?<MaybeWithBracket>@\\()|(?<WithoutBracket>(?<=[^\\w]|^|\\\\n)@))(?<ParameterName>(?(MaybeWithBracket)[\\w ]+(\\.[\\w ]+)*|\\w+(\\.\\w+)*))((?<MaybeExistsFormat>:(?!\\s*@))|())(?<Format>(?(MaybeExistsFormat)(?(MaybeWithBracket)([^\"'()]|(?<=\\\\)(\\(|\\)|\\\"|'))*|[^\\(\\)\\{\\}\\[\\]\\s\\\"']*)|))(?<EndWithBracketIfExists>(?(MaybeWithBracket)\\)|))(?<EndWithQuotesIfExists>(?(MaybeWithDoubleQuote)\\\"|(?<EndWithQuotesIfExists>(?(MaybeWithSingleQuote)\\'|))))" #
Defines a regular-expression pattern that matches a RegexPattern.Parameter placeholder and consumes matching surrounding single or double quotes when present.

Remarks

This pattern is built from RegexPattern.Groups.MaybeWithQuotes, RegexPattern.Parameter, and RegexPattern.Groups.EndWithQuotesIfExists. Its named quote groups allow SubstitutionsProcessor to distinguish quoted placeholders from unquoted placeholders when producing replacement text.

Example

In '@document.Employee.Amount:format' and "@(document.Employee.Amount:format)", the matches include the surrounding single and double quotes, respectively.

Nested Types

public static class RegexPattern.Groups #
Contains named groups and fragments used to compose placeholder-matching regular-expression patterns.
View RegexPattern.Groups

Remarks

Update group names and related pattern fragments together to keep references in consuming expressions valid.