Table of Contents

AhoCorasickMatch Struct

Definition

Namespace
Bodu.Collections.Generic.Trees
Assembly
Bodu.Collections.dll
Package
Bodu.Collections 1.0.0
Source
AhoCorasickMatch.cs

Represents a single pattern occurrence reported by EnumerateMatches(string).

public readonly struct AhoCorasickMatch : IEquatable<AhoCorasickMatch>
Implements
Inherited Members
Extension Methods

Remarks

Matches are value-equatable: two matches are equal when they report the same pattern at the same start index.

Constructors

AhoCorasickMatch(string, int)

Represents a single pattern occurrence reported by EnumerateMatches(string).

public AhoCorasickMatch(string Pattern, int Start)

Parameters

Pattern string

The pattern that matched.

Start int

The zero-based index in the text at which the occurrence begins.

Remarks

Matches are value-equatable: two matches are equal when they report the same pattern at the same start index.

Properties

End

Gets the exclusive zero-based end index of the occurrence.

public int End { get; }

Property Value

int

The index immediately after the last matched character, equal to Start plus the pattern length.

Pattern

The pattern that matched.

public string Pattern { get; init; }

Property Value

string

Start

The zero-based index in the text at which the occurrence begins.

public int Start { get; init; }

Property Value

int

Methods

Deconstruct(out string, out int)

public void Deconstruct(out string Pattern, out int Start)

Parameters

Pattern string
Start int

Equals(AhoCorasickMatch)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(AhoCorasickMatch other)

Parameters

other AhoCorasickMatch

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(AhoCorasickMatch, AhoCorasickMatch)

public static bool operator ==(AhoCorasickMatch left, AhoCorasickMatch right)

Parameters

left AhoCorasickMatch
right AhoCorasickMatch

Returns

bool

operator !=(AhoCorasickMatch, AhoCorasickMatch)

public static bool operator !=(AhoCorasickMatch left, AhoCorasickMatch right)

Parameters

left AhoCorasickMatch
right AhoCorasickMatch

Returns

bool

Applies to

ProductVersions
.NET8, 10