110,534
社区成员
发帖
与我相关
我的任务
分享
string str = "电视剧语第1集 电视剧粤语第1集 电视剧第2集 电视剧粤语第2集 粤剧大全第3集";
Regex re = new Regex("\\b\\w[^粤]+\\b", RegexOptions.None);
MatchCollection mc = re.Matches(str);
string result = string.Empty;
foreach (Match ma in mc)
{
result += ma.Value + "—";
}
结果:
电视剧语第1集-电视剧第2集-粤剧大全第3集