日期:2014-05-17 浏览次数:20745 次
string s = "abcd ewr wertertretery Bar Level(Ref. b1) 620.1 mV * 650.0 750.0"; Regex reg = new Regex(@"(?<=Bar Level\(Ref. b1\).*?)-?\d+(.\d+)?"); Console.WriteLine(reg.Match(s));
------解决方案--------------------
string str = "abcd ewr wertertretery Bar Level(Ref. b1) 620.1 mV * 650.0 750.0"; Match m = Regex.Match(str, @"-?\d+\.?\d+\b"); Console.WriteLine(m);