日期:2014-05-18 浏览次数:20717 次
string source = @"www.icbc.com.cn || www.baidu.com || www.sina.cn || www.csdn.net"; Regex reg = new Regex(@"www.(?<name>\w*\W*).(com|cn|net)"); Match mm = reg.Match(source); MatchCollection mc = reg.Matches(source); foreach (Match m in mc) { MessageBox.Show(m.Groups["name"].Value); }