I have a regex that should* pickup to results in a string:
Input string:
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
Regex:
[]][ A-Za-z /.]+.vmx [ ]
The regex matches the folowing part of the string:
] TinyCore Linux/TinyCore Linux.vmx
but is should also match:
] Debain6/Debain6.vmx
My code is as follows:
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());
}
you lost digits
\dyour regex:
[]][\dA-Za-z /.]+.vmx [ ]and my upgrade
\][\dA-Za-z\s/.]+\.vmx