Table of Contents

TextFilterOptions Class

Definition

Namespace
Bodu.Text.Filtering
Assembly
Bodu.Text.Filtering.dll
Package
Bodu.Text.Filtering 1.0.0
Source
TextFilterOptions.cs

Provides configuration for building a TextFilter.

public sealed class TextFilterOptions
Inheritance
TextFilterOptions
Inherited Members
Extension Methods

Remarks

Options are read once when the filter is built; changing an options instance afterwards has no effect on filters already built from it. Invalid option values are reported by Build(IEnumerable<TextFilterPattern>, TextFilterOptions?) rather than by the property setters.

Constructors

TextFilterOptions()

public TextFilterOptions()

Properties

CaptureEvaluationTime

Gets a value indicating whether the filter accumulates evaluation time in its statistics.

public bool CaptureEvaluationTime { get; init; }

Property Value

bool

true to measure and accumulate the time spent evaluating values, exposed via EvaluationTime; otherwise false. The default is false.

IgnoreCase

Gets a value indicating whether patterns match case-insensitively by default.

public bool IgnoreCase { get; init; }

Property Value

bool

true to match ordinally ignoring case; false to match ordinally and case-sensitively. The default is true. Individual patterns can override this via IgnoreCase.

Remarks

Comparison is always ordinal - culture-sensitive comparison is not supported, because the engine's optimized matchers operate on raw character values.

Mode

Gets the evaluation mode that determines how patterns combine into a decision.

public TextFilterEvaluationMode Mode { get; init; }

Property Value

TextFilterEvaluationMode

The evaluation mode. The default is AnyMatch.

RegexMatchTimeout

Gets the match timeout applied to regular-expression patterns.

public TimeSpan RegexMatchTimeout { get; init; }

Property Value

TimeSpan

The per-match timeout. The default is 100 milliseconds. Must be positive or InfiniteMatchTimeout.

Remarks

The timeout is a guard against pathologically backtracking regular expressions. The filter prefers the linear-time NonBacktracking engine, under which the timeout is effectively unreachable; it applies to patterns that fall back to the backtracking engine. A timed-out pattern fails safe: a timed-out include does not admit the value, and a timed-out exclude still rejects it.

Applies to

ProductVersions
.NET8, 10