Table of Contents

Class RegexPattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching on strings that follow a regular expression.

public record RegexPattern : Pattern<string?>, IEquatable<Pattern>, IEquatable<Pattern<string?>>, IEquatable<RegexPattern>
Inheritance
RegexPattern
Implements
Inherited Members

Constructors

RegexPattern(RegexPattern)

protected RegexPattern(RegexPattern original)

Parameters

original RegexPattern

RegexPattern(string)

Creates a regex pattern.

public RegexPattern(string pattern)

Parameters

pattern string

The regular expression to match.

RegexPattern(Regex)

Defines the pattern matching on strings that follow a regular expression.

public RegexPattern(Regex ExpectedPattern)

Parameters

ExpectedPattern Regex

The expected regular expression the input string should follow.

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

ExpectedPattern

The expected regular expression the input string should follow.

public Regex ExpectedPattern { get; init; }

Property Value

Regex

Methods

Deconstruct(out Regex)

public void Deconstruct(out Regex ExpectedPattern)

Parameters

ExpectedPattern Regex

Equals(Pattern<string?>?)

public override sealed bool Equals(Pattern<string?>? other)

Parameters

other Pattern<string>

Returns

bool

Equals(RegexPattern?)

public virtual bool Equals(RegexPattern? other)

Parameters

other RegexPattern

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Format(IndentedTextWriter)

Serializes the pattern to a readable string.

public override void Format(IndentedTextWriter writer)

Parameters

writer IndentedTextWriter

The output stream.

GetHashCode()

public override int GetHashCode()

Returns

int

Match(string?, MatchingContext)

Attempts to match the provided input to the pattern.

public override IMatchNode<string?>? Match(string? identifier, MatchingContext context)

Parameters

identifier string
context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<string>

When successful, returns the root node of the match tree, otherwise null.

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(RegexPattern?, RegexPattern?)

public static bool operator ==(RegexPattern? left, RegexPattern? right)

Parameters

left RegexPattern
right RegexPattern

Returns

bool

operator !=(RegexPattern?, RegexPattern?)

public static bool operator !=(RegexPattern? left, RegexPattern? right)

Parameters

left RegexPattern
right RegexPattern

Returns

bool