FluentRegex

GroupBuilder

Namespace: FluentRegex

Class GroupBuilder builds groups for a regular expression pattern. Inherits from Builder.

public class GroupBuilder : Builder, IBuilder

Inheritance ObjectBuilderGroupBuilder
Implements IBuilder

Properties

Pattern

Gets or sets the pattern.

public StringBuilder Pattern { get; set; }

Property Value

StringBuilder

GroupName

The name of the named capture group when GroupBuilder.GroupType is GroupType.NamedCapturing.

public string GroupName { get; }

Property Value

String

GroupType

The GroupType of the group.

public GroupType GroupType { get; }

Property Value

GroupType

GroupStyle

The NamedGroupStyle of the group.

public Nullable<NamedGroupStyle> GroupStyle { get; }

Property Value

Nullable<NamedGroupStyle>

Constructors

GroupBuilder(Builder, NamedGroupStyle, String)

Initializes a new instance of the GroupBuilder class with a PatternBuilder, and the declared NamedGroupStyle and GroupBuilder.GroupName.

public GroupBuilder(Builder patternBuilder, NamedGroupStyle namedGroupStyle, string groupName)

Parameters

patternBuilder Builder

namedGroupStyle NamedGroupStyle

groupName String

GroupBuilder(Builder, GroupType)

Initializes a new instance of the GroupBuilder class with a PatternBuilder, and the declared GroupBuilder.GroupType.

public GroupBuilder(Builder patternBuilder, GroupType groupType)

Parameters

patternBuilder Builder

groupType GroupType

GroupBuilder(Builder)

Initializes a new instance of the GroupBuilder class with a PatternBuilder.

public GroupBuilder(Builder patternBuilder)

Parameters

patternBuilder Builder

Methods

Build()

Builds the group.

public object Build()

Returns

Object
The PatternBuilder.

StartCharacterClass()

Initializes a new instance of the CharacterClassBuilder class which is used to build a character class inline.

public CharacterClassBuilder StartCharacterClass()

Returns

CharacterClassBuilder

Start_Group()

Starts building the group by adding an opening parenthesis to the pattern. Depending on the GroupBuilder.GroupType, the method will add the appropriate syntax to the pattern.

internal GroupBuilder Start_Group()

Returns

GroupBuilder
A new instance of the GroupBuilder class.

StartAnchor()

Initializes a new instance of the AnchorBuilder class which is used to build an anchor inline.

public AnchorBuilder StartAnchor()

Returns

AnchorBuilder
A new instance of the AnchorBuilder class.

AppendLiteral(String)

The AppendLiteral method appends a string to the pattern. This hides the IBuilder.AppendLiteral(String) method from the base class.

public GroupBuilder AppendLiteral(string literal)

Parameters

literal String

Returns

GroupBuilder
GroupBuilder

EndGroup()

internal GroupBuilder EndGroup()

Returns

GroupBuilder

Validate()

internal void Validate()