NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Regex.Match (String)

Matches a regular expression with a string and returns the precise result as a RegexMatch object.

[Visual Basic]
Overloads Public Function Match( _
   ByVal input As String _
) As Match
[C#]
public Match Match(
   string input
);
[C++]
public: Match* Match(
   String* input
);
[JScript]
public function Match(
   input : String
) : Match;

Parameters

input
String containing the text to search.

Return Value

A Regular Expression Match object.

Remarks

Match is supplied in two forms: the caller can optionally specify a starting position (via startpos). If not specified, the default startpos is at the beginning or end of the interval (the beginning if the Regex is left-to-right, and the end if right-to-left).

Note that a match can be restricted so that it does not scan by anchoring the regular expression with a ?\G? (at the left for a left-to-right pattern, or at the right for a right-to-left pattern). This restricts the match so that it must start exactly at startpos.

When a Regex is left-to-right (the default), the match and the scan proceed rightward, starting at the character at startpos. When a Regex is right-to-left (constructed with the ?r? option), the match and scan are in the opposite direction and begin with the character at startpos-1.

The static Match methods return the RegexMatch corresponding to the first match of the specified pattern in the specified string. The methods are equivalent to the like-named instance methods and are provided for convenience.

See Also

Regex Class | Regex Members | System.Text.RegularExpressions Namespace | Regex.Match Overload List