日期:2014-05-17 浏览次数:20970 次
System.IO.StreamReader reader1 = new System.IO.StreamReader("e:\\1.txt",Encoding.Default);
string str = @"aaaaa主题=中国YES,BBBBB主题=日本YES,主题=美国YES,CCCCCCC";
string strmatch = @"(?is)(?<=主题=)[^a-z]+(?=YES)";
System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(strmatch);
egularExpressions.MatchCollection mc = reg.Matches(str);
foreach (System.Text.RegularExpressions.Match mm in mc)
{
MessageBox.Show(mm.Value);
}