日期:2014-05-17 浏览次数:20812 次
string tempStr = @"Left Channel: Frequency = 1.020 kHz Level = 11.93 dBu THD+N = 18.065 % Right Channel: Frequency = 1.020 kHz Level = 11.94 dBu THD+N = 18.049 % Level Difference (L - R): -0.006 dB Phase Difference (L - R): -0.01 deg"; string pattern = @"-?\d+\.?\d*"; MatchCollection mc = Regex.Matches(tempStr, pattern, RegexOptions.Multiline|RegexOptions.IgnoreCase); for (int i = 0; i < mc.Count; i++) { string value = mc[i].Value;//循环得到数字 }