Dim str As String = "计量单位"
For Each s As String In str.split(",")
Dim mc = System.Text.RegularExpressions.Regex.Matches(s, "[0-9.]+")
MessageBox.Show(mc(0).value)
' m = mc(0).value
Next
输出结果有错误。
Dim str As String = "计量单位"
Dim r As New System.Text.RegularExpressions.Regex("[0-9.]+")
For Each s As String In str.split(",")
If r.isMatch(s) Then
Dim mc = r.Matches(s)
MessageBox.Show(mc(0).value)
End If
Next