Regex re = new Regex(@"<hkstrong:([^<>]+)\s([^<>]+)>([\S\s]*?)</hkstrong:\1>", RegexOptions.IgnoreCase | RegexOptions.Singleline); MatchCollection mc = re.Matches(str);把红色部分替换成你自己的正则就可以了
MatchCollection mc = Regex.Matches("text", @"(?<=[\u4e00-\u9fa5]*)[A-Z]+\d+(?=\()", RegexOptions.None); foreach (Match ma in mc) {
(?<=[\u4e00-\u9fa5]*)[A-Z]+\d+(?=\()
[a-zA-Z]?\d+(?=\()
貌似就可以了
Regex re = new Regex(@"<hkstrong:([^<>]+)\s([^<>]+)>([\S\s]*?)</hkstrong:\1>", RegexOptions.IgnoreCase | RegexOptions.Singleline);
MatchCollection mc = re.Matches(str);把红色部分替换成你自己的正则就可以了
foreach (Match ma in mc)
{
//输出ma.Value
}