指定した入力文字列内で、 pattern パラメータで指定された正規表現と一致する対象を検索します。
Overloads Public Shared Function Match( _ ByVal input As String, _ ByVal pattern As String _) As Match
[C#]
public static MatchMatch(stringinput,stringpattern);
[C++]
public: static Match* Match(String* input,String* pattern);
[JScript]
public static function Match(input : String,pattern : String) : Match;
パラメータ
- input
一致する対象を検索する文字列。 - pattern
一致させる正規表現パターン。
戻り値
正規表現 Match オブジェクト。
解説
静的 Match メソッドは、正規表現パターンを指定して Regex オブジェクトを構築し、インスタンス メソッド Match を呼び出す操作と同じです。この静的メソッドは、 Regex オブジェクトを明示的に作成しなくても、正規表現を単独で 1 回だけ使用できるようにする目的で用意されています。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET
参照
Regex クラス | Regex メンバ | System.Text.RegularExpressions 名前空間 | Regex.Match オーバーロードの一覧