Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns a new Match object with the results for the next match, starting at the position at which the last match ended (at the character after the last matched character).
Namespace: System.Text.RegularExpressions
Assembly: System.Text.RegularExpressions (in System.Text.RegularExpressions.dll)
Syntax
'Declaration
Public Function NextMatch As Match
public Match NextMatch()
public:
Match^ NextMatch()
member NextMatch : unit -> Match
public function NextMatch() : Match
Return Value
Type: System.Text.RegularExpressions. . :: . .Match
The next regular expression match.
Remarks
This method is similar to calling Regex..::..Match(String, Int32) again and passing (Index+Length) as the new starting position.
Note
This method does not modify the current instance. Instead, it returns a new Match object that contains information about the next match.
Attempting to retrieve the next match may throw a RegexMatchTimeoutException if a time-out value for matching operations is in effect and the attempt to find the next match exceeds that time-out interval.
Notes to Callers
When a match attempt is repeated by calling the NextMatch method, the regular expression engine gives empty matches special treatment. Usually, NextMatch begins the search for the next match exactly where the previous match left off. However, after an empty match, the NextMatch method advances by one character before trying the next match. This behavior guarantees that the regular expression engine will progress through the string. Otherwise, because an empty match does not result in any forward movement, the next match would start in exactly the same place as the previous match, and it would match the same empty string repeatedly.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.