संपादित करें

इसके माध्यम से साझा किया गया


Regex.EnumerateMatches Method

Definition

Overloads

EnumerateMatches(ReadOnlySpan<Char>, String, RegexOptions, TimeSpan)

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

EnumerateMatches(ReadOnlySpan<Char>, String, RegexOptions)

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

EnumerateMatches(ReadOnlySpan<Char>)

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

EnumerateMatches(ReadOnlySpan<Char>, Int32)

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

EnumerateMatches(ReadOnlySpan<Char>, String)

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

EnumerateMatches(ReadOnlySpan<Char>, String, RegexOptions, TimeSpan)

Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

public:
 static System::Text::RegularExpressions::Regex::ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input, System::String ^ pattern, System::Text::RegularExpressions::RegexOptions options, TimeSpan matchTimeout);
public static System.Text.RegularExpressions.Regex.ValueMatchEnumerator EnumerateMatches (ReadOnlySpan<char> input, string pattern, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);
static member EnumerateMatches : ReadOnlySpan<char> * string * System.Text.RegularExpressions.RegexOptions * TimeSpan -> System.Text.RegularExpressions.Regex.ValueMatchEnumerator
Public Shared Function EnumerateMatches (input As ReadOnlySpan(Of Char), pattern As String, options As RegexOptions, matchTimeout As TimeSpan) As Regex.ValueMatchEnumerator

Parameters

input
ReadOnlySpan<Char>

The span to search for a match.

pattern
String

The regular expression pattern to match.

options
RegexOptions

A bitwise combination of the enumeration values that specify options for matching.

matchTimeout
TimeSpan

A time-out interval, or InfiniteMatchTimeout to indicate that the method should not time out.

Returns

A Regex.ValueMatchEnumerator to iterate over the matches.

Exceptions

pattern is null.

options is not a valid bitwise combination of RegexOptions values, or matchTimeout is negative, zero, or greater than approximately 24 days.

A regular expression parsing error occurred.

Remarks

Each match won't actually happen until MoveNext() is invoked on the enumerator, with one match being performed per MoveNext() call. Since the evaluation of the match happens lazily, any changes to the passed in input in between calls to MoveNext() will affect the match results. The enumerator returned by this method, as well as the structs returned by the enumerator that wrap each match found in the input are ref structs which make this method be amortized allocation free.

Applies to

EnumerateMatches(ReadOnlySpan<Char>, String, RegexOptions)

Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

public:
 static System::Text::RegularExpressions::Regex::ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input, System::String ^ pattern, System::Text::RegularExpressions::RegexOptions options);
public static System.Text.RegularExpressions.Regex.ValueMatchEnumerator EnumerateMatches (ReadOnlySpan<char> input, string pattern, System.Text.RegularExpressions.RegexOptions options);
static member EnumerateMatches : ReadOnlySpan<char> * string * System.Text.RegularExpressions.RegexOptions -> System.Text.RegularExpressions.Regex.ValueMatchEnumerator
Public Shared Function EnumerateMatches (input As ReadOnlySpan(Of Char), pattern As String, options As RegexOptions) As Regex.ValueMatchEnumerator

Parameters

input
ReadOnlySpan<Char>

The span to search for a match.

pattern
String

The regular expression pattern to match.

options
RegexOptions

A bitwise combination of the enumeration values that specify options for matching.

Returns

A Regex.ValueMatchEnumerator to iterate over the matches.

Exceptions

pattern is null.

options is not a valid bitwise combination of RegexOptions values.

A regular expression parsing error occurred.

Remarks

Each match won't actually happen until MoveNext() is invoked on the enumerator, with one match being performed per MoveNext() call. Since the evaluation of the match happens lazily, any changes to the passed in input in between calls to MoveNext() will affect the match results. The enumerator returned by this method, as well as the structs returned by the enumerator that wrap each match found in the input are ref structs which make this method be amortized allocation free.

Applies to

EnumerateMatches(ReadOnlySpan<Char>)

Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

public:
 System::Text::RegularExpressions::Regex::ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input);
public System.Text.RegularExpressions.Regex.ValueMatchEnumerator EnumerateMatches (ReadOnlySpan<char> input);
member this.EnumerateMatches : ReadOnlySpan<char> -> System.Text.RegularExpressions.Regex.ValueMatchEnumerator
Public Function EnumerateMatches (input As ReadOnlySpan(Of Char)) As Regex.ValueMatchEnumerator

Parameters

input
ReadOnlySpan<Char>

The span to search for a match.

Returns

A Regex.ValueMatchEnumerator to iterate over the matches.

Remarks

Each match won't actually happen until MoveNext() is invoked on the enumerator, with one match being performed per MoveNext() call. Since the evaluation of the match happens lazily, any changes to the passed in input in between calls to MoveNext() will affect the match results. The enumerator returned by this method and the structs returned by the enumerator that wrap each match found in the input are ref structs, which make this method be amortized allocation free.

Applies to

EnumerateMatches(ReadOnlySpan<Char>, Int32)

Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

public:
 System::Text::RegularExpressions::Regex::ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input, int startat);
public System.Text.RegularExpressions.Regex.ValueMatchEnumerator EnumerateMatches (ReadOnlySpan<char> input, int startat);
member this.EnumerateMatches : ReadOnlySpan<char> * int -> System.Text.RegularExpressions.Regex.ValueMatchEnumerator
Public Function EnumerateMatches (input As ReadOnlySpan(Of Char), startat As Integer) As Regex.ValueMatchEnumerator

Parameters

input
ReadOnlySpan<Char>

The span to search for a match.

startat
Int32

The zero-based character position at which to start the search.

Returns

A Regex.ValueMatchEnumerator to iterate over the matches.

Remarks

Each match won't actually happen until MoveNext() is invoked on the enumerator, with one match being performed per MoveNext() call. Since the evaluation of the match happens lazily, any changes to the passed in input in between calls to MoveNext() will affect the match results. The returned enumerator and the structs returned by the enumerator that wrap each match found in the input are ref structs, which make this method be amortized allocation free.

Applies to

EnumerateMatches(ReadOnlySpan<Char>, String)

Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs
Source:
Regex.EnumerateMatches.cs

Searches an input span for all occurrences of a regular expression and returns a Regex.ValueMatchEnumerator to iterate over the matches.

public:
 static System::Text::RegularExpressions::Regex::ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input, System::String ^ pattern);
public static System.Text.RegularExpressions.Regex.ValueMatchEnumerator EnumerateMatches (ReadOnlySpan<char> input, string pattern);
static member EnumerateMatches : ReadOnlySpan<char> * string -> System.Text.RegularExpressions.Regex.ValueMatchEnumerator
Public Shared Function EnumerateMatches (input As ReadOnlySpan(Of Char), pattern As String) As Regex.ValueMatchEnumerator

Parameters

input
ReadOnlySpan<Char>

The span to search for a match.

pattern
String

The regular expression pattern to match.

Returns

A Regex.ValueMatchEnumerator to iterate over the matches.

Exceptions

pattern is null.

A regular expression parsing error occurred.

Remarks

Each match won't actually happen until MoveNext() is invoked on the enumerator, with one match being performed per MoveNext() call. Since the evaluation of the match happens lazily, any changes to the passed in input in between calls to MoveNext() will affect the match results. The enumerator returned by this method, as well as the structs returned by the enumerator that wrap each match found in the input are ref structs which make this method be amortized allocation free.

Applies to