Skip to content

Regex.EnumerateMatchesUnchecked Method

Definition

Namespace: Corvus.Ecma262.RegularExpressions
Assembly: Corvus.Regex.Ecma262.dll

Overloads

Method Description
EnumerateMatchesUnchecked(ReadOnlySpan<byte>) Enumerates the matches in a UTF-8 text, allocating nothing.
EnumerateMatchesUnchecked(ReadOnlySpan<byte>, int) Enumerates the matches in a UTF-8 text at or after a position, allocating nothing.
EnumerateMatchesUnchecked(ReadOnlySpan<byte>, Span<ValueCapture>) Enumerates the matches in a UTF-8 text, allocating nothing, and reports what each group captured.
EnumerateMatchesUnchecked(ReadOnlySpan<byte>, int, Span<ValueCapture>) Enumerates the matches in a UTF-8 text at or after a position, allocating nothing, and reports what each group captured.

EnumerateMatchesUnchecked(ReadOnlySpan<byte>)

Source: Regex.Matching.cs

Enumerates the matches in a UTF-8 text, allocating nothing.

public Utf8ValueMatchEnumerator EnumerateMatchesUnchecked(ReadOnlySpan<byte> utf8)

Parameters

Name Type Description
utf8 ReadOnlySpan<byte> The text.

Returns

Utf8ValueMatchEnumerator

The enumerator.

Remarks

The text is not checked to be UTF-8: this is for text its caller knows to be UTF-8, such as the strings of parsed JSON, or a text checked once and matched many times. Bytes that are not UTF-8 are read as U+FFFD one at a time; the member without Unchecked refuses them.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

EnumerateMatchesUnchecked(ReadOnlySpan<byte>, int)

Source: Regex.Matching.cs

Enumerates the matches in a UTF-8 text at or after a position, allocating nothing.

public Utf8ValueMatchEnumerator EnumerateMatchesUnchecked(ReadOnlySpan<byte> utf8, int startAt)

Parameters

Name Type Description
utf8 ReadOnlySpan<byte> The text.
startAt int The position, in bytes, at the start of a character.

Returns

Utf8ValueMatchEnumerator

The enumerator.

Remarks

The text is not checked to be UTF-8: this is for text its caller knows to be UTF-8, such as the strings of parsed JSON, or a text checked once and matched many times. Bytes that are not UTF-8 are read as U+FFFD one at a time; the member without Unchecked refuses them.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

EnumerateMatchesUnchecked(ReadOnlySpan<byte>, Span<ValueCapture>)

Source: Regex.Spans.cs

Enumerates the matches in a UTF-8 text, allocating nothing, and reports what each group captured.

public Utf8ValueMatchEnumerator EnumerateMatchesUnchecked(ReadOnlySpan<byte> utf8, Span<ValueCapture> captures)

Parameters

Name Type Description
utf8 ReadOnlySpan<byte> The text.
captures Span<ValueCapture> Receives the captures of each match; its length must be at least GroupCount + 1.

Returns

Utf8ValueMatchEnumerator

The enumerator.

Remarks

The text is not checked to be UTF-8: this is for text its caller knows to be UTF-8, such as the strings of parsed JSON, or a text checked once and matched many times. Bytes that are not UTF-8 are read as U+FFFD one at a time; the member without Unchecked refuses them.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

EnumerateMatchesUnchecked(ReadOnlySpan<byte>, int, Span<ValueCapture>)

Source: Regex.Spans.cs

Enumerates the matches in a UTF-8 text at or after a position, allocating nothing, and reports what each group captured.

public Utf8ValueMatchEnumerator EnumerateMatchesUnchecked(ReadOnlySpan<byte> utf8, int startAt, Span<ValueCapture> captures)

Parameters

Name Type Description
utf8 ReadOnlySpan<byte> The text.
startAt int The position, in bytes, at the start of a character.
captures Span<ValueCapture> Receives the captures of each match; its length must be at least GroupCount + 1.

Returns

Utf8ValueMatchEnumerator

The enumerator.

Remarks

The text is not checked to be UTF-8: this is for text its caller knows to be UTF-8, such as the strings of parsed JSON, or a text checked once and matched many times. Bytes that are not UTF-8 are read as U+FFFD one at a time; the member without Unchecked refuses them.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue