In (Visual Basic, .NET):
Dim result As Match = Regex.Match(aStr, aMatchStr)
If result.Success Then
Dim result0 As String = result.Groups(0).Value
Dim result1 As String = result.Groups(1).Value
End If
with: aStr equal to (whitespace is normal space and there is 7 spaces between "n" and "(" ):
"AMEVDIEERPK + 7 Oxidation (M)"
I don't understand why result1 becomes an empty string for aMatchStr equal to
"\s*(\d*).*?Oxidation\s+\(M\)"
but becomes "7" for aMatchStr equal to
"\s*(\d*)\s*Oxidation\s+\(M\)"
(result0 becomes equal to "AMEVDIEERPK + 7 Oxidation (M)")
(This is from MSQuant, <http://msquant.sourceforge.net/>, MascotResultParser.vb, function modificationParseMatch() - <http://shrinkster.com/1352>).