我的文件是
> A B C D unuse data <begin> Addd as ss 1 My name is 2323 33 text
> </end> 34344 no need
我的代码是
StringBuilder mSb = new StringBuilder();
StreamReader sr = new StreamReader(@"E:\check.txt");
String line;
while (sr.ReadLine() != null)
{
mSb.AppendLine(sr.ReadLine());
}
string matc = new Regex(@"(<begin>)(\n?.*)*</end>)?").Match(mSb.ToString()).ToString();
在这里它读取所有文件,但我只想直到我删除?从头到尾,我的程序崩溃了..