title: Read text file by Regex in C#
body: <p>Hi I am reading a log file(Text File) using C# in my application and I am reading the log file using dates  . And also I  created a Regex format for get the exception by date basis.</p>
  
  <p>Now I am getting the exception by using this regex format successfully but I am not able to get the Exception line properly. The last letter of the exception line is missing for me when i am going to use the below regex format. Tell me What I did wrong in this line. Can anyone please tell me the solution to get the full line of the exception. </p>
  
  <p>Thanks in advance.</p>
  
  <p>My Code is:</p>
  
  <pre><code> var matches = Regex.Matches(sb.ToString(), @"(?&lt;date&gt;\d{4}\-\d{2}\-\d{2})\s(?&lt;message&gt;(.(?!\d{4}\-\d{2}\-\d{2}))+)");
  </code></pre>
  
  <p>My txt file  looks like</p>
  
  <pre><code>2012-06-21 04:35:30,177|| [5]|| DEBUG|| GID.AAFramework.Shared.LdapAuthentication.PrincipleImpl||  PrincipleImpl: IsInRole(string role)-  Entered
  2012-06-21 04:35:30,177|| [5]|| DEBUG|| GID.AAFramework.Shared.LdapAuthentication.PrincipleImpl||  PrincipleImpl: IsInRole(string role)-  IsInRole(ADMINUSER) 
  results : True
  </code></pre>
  
  <p>in my log file all the lines starts with date but in some lines messages are too long so it comes to next line..so i want to read the file starts with date means i misses the line starts with that message...</p>