Regex.ValueMatchEnumerator 結構

定義

表示列舉值,其中包含一組成功的相符專案,方法是反復地將正則運算式模式套用至輸入範圍。

public: value class Regex::ValueMatchEnumerator
public ref struct Regex.ValueMatchEnumerator
type Regex.ValueMatchEnumerator = struct
Public Structure Regex.ValueMatchEnumerator
繼承
Regex.ValueMatchEnumerator

備註

列舉值沒有公用建構函式。 方法 EnumerateMatches(ReadOnlySpan<Char>) 會傳 Regex.ValueMatchEnumerator 回 物件。列舉值會延遲逐一查看零個或多個 ValueMatch 物件。 如果範圍中至少有一個成功的相符專案,則會 MoveNext() 傳回 true ,並將 Current 包含第一個 ValueMatch 。 如果沒有成功的相符專案,則會 MoveNext()false 回 並 CurrentInvalidOperationException 回 。

此類型是 ref 結構,因為它會將輸入範圍儲存為欄位,以便延遲逐一查看。

屬性

Current

ValueMatch取得列舉值目前位置的專案。

方法

GetEnumerator()

提供列舉值,逐一查看輸入範圍中的相符專案。

MoveNext()

將列舉值前進到範圍中的下一個相符專案。

適用於