issue with regex in C#
- by Dilip
my file is
> A B C D unuse data <begin> Addd as ss 1 My name is 2323 33 text
> </end> 34344 no need
and my code is
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();
here it reading all file , but i just want till
if i am removing ? from end , my program is crashing ..
Thanks