私は文字列の結果を拾うべき*正規表現を持っています:
入力文字列:
Vmid Name File Guest OS Version Annotation
3 TinyCore Linux [datastore1] TinyCore Linux/TinyCore Linux.vmx otherLinuxGuest vmx-08
4 Debain6 [datastore1] Debain6/Debain6.vmx ubuntu64Guest vmx-08
正規表現:
[]][ A-Za-z /.]+.vmx [ ]
正規表現は、文字列の次の部分と一致します。
] TinyCore Linux/TinyCore Linux.vmx
しかし、これも一致する必要があります:
] Debain6/Debain6.vmx
私のコードは次のとおりです。
private void regexTest_Click(object sender, EventArgs e)
{
Regex regex = new Regex("[]][ A-Za-z /.]+.vmx [ ]");
MatchCollection match = regex.Matches(input);
foreach (Match matchvalue in match)
{
MessageBox.Show(matchvalue.ToString());
}