Assembly: OptimaJet.Workflow.Core

Class RegexPattern.Groups

OptimaJet.Workflow.Core.CodeActions.RegexPattern.Groups

Contains named groups and fragments used to compose placeholder-matching regular-expression patterns.

public static class RegexPattern.Groups

Fields

public const string ParameterName = "(?<ParameterName>(?(MaybeWithBracket)[\\w ]+(\\.[\\w ]+)*|\\w+(\\.\\w+)*))" #

Gets a named-group fragment that captures the parameter name part.

Example

In input like @document.Employee.Amount:format or @(document.Employee.Amount:format), this fragment captures document.Employee.Amount as a named group.

public const string FindParameter = "(?<FindParameter>(?<MaybeWithBracket>@\\()|(?<WithoutBracket>(?<=[^\\w]|^|\\\\n)@))" #

Gets a named-group fragment that detects a parameter prefix.

Remarks

This fragment matches either @( from RegexPattern.Groups.MaybeWithBracket or an unparenthesized @ from RegexPattern.Groups.WithoutBracket, and stores the result as a named group.

public const string MaybeWithBracket = "(?<MaybeWithBracket>@\\()" #

Matches the opening bracketed prefix sequence @(.

public const string EndWithBracketIfExists = "(?<EndWithBracketIfExists>(?(MaybeWithBracket)\\)|))" #

Conditionally matches a closing parenthesis when @( was matched.

public const string WithoutBracket = "(?<WithoutBracket>(?<=[^\\w]|^|\\\\n)@)" #

Matches an unparenthesized @ marker at the start of the input or when it is not immediately preceded by a word character.

public const string MaybeExistsFormat = "((?<MaybeExistsFormat>:(?!\\s*@))|())" #

Captures an optional : delimiter that begins a format specifier.

Remarks

The delimiter is not captured when it is followed by optional whitespace and another @ marker. An empty format after the delimiter is permitted.

public const string Format = "(?<Format>(?(MaybeExistsFormat)(?(MaybeWithBracket)([^\"'()]|(?<=\\\\)(\\(|\\)|\\\"|'))*|[^\\(\\)\\{\\}\\[\\]\\s\\\"']*)|))" #

Gets a named-group fragment that captures the format value when it is present.

Remarks

This fragment is applied only when RegexPattern.Groups.MaybeExistsFormat is present.

public const string MaybeWithQuotes = "(?:((?<MaybeWithSingleQuote>\\')|())|((?<MaybeWithDoubleQuote>\\\")|()))" #

Captures an optional opening single or double quote before the RegexPattern.Parameter pattern.

public const string EndWithQuotesIfExists = "(?<EndWithQuotesIfExists>(?(MaybeWithDoubleQuote)\\\"|(?<EndWithQuotesIfExists>(?(MaybeWithSingleQuote)\\'|))))" #

Captures an optional closing quote that matches the quote captured by RegexPattern.Groups.MaybeWithQuotes.

Remarks

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