按照你的要求编写的C#程序如下(输出是你要求的样子)
using System;
using System.Text.RegularExpressions;
namespace MatchApplication{
class MatchClass{
static void Main(string[] args){
string s="diocrwer rwerf docq";
MatchCollection mc =Regex.Matches(s, "]*?id=\"c\"[^<>]*?/>",RegexOptions.IgnoreCase);
foreach (Match m in mc){
Console.WriteLine(m.Groups[0].Value);
}
Console.ReadKey();
}
}
}