日期:2014-05-17 浏览次数:20760 次
string numstr = @"Puppet Labs Puppet 2.7.x sp2Puppet Labs Puppet 2.6.x sp3
Puppet Labs Puppet 1.1.1.1 emc
Mozilla seamonkey 2.xMozilla Firefox 3.x
";
var mc = Regex.Split(numstr, @"(Puppet\s*Labs\s*Puppet[\s\S]*?(?=Puppet))
------解决方案--------------------
(Mozilla[\s\S]*?(?=Mozilla))");
foreach (string mcnum in mc)
{
Console.WriteLine(mcnum);
}
foreach(Match m in Regex.Matches(yourstr,@"(?i).+?(\d+(\.\d+)?)+(\.x)?\s*((?:sp
------解决方案--------------------
emc
------解决方案--------------------
update)\d+)?"))
{
//m.Value即是你想要的
}