title: Parsing multi sections of a text file using regex in C#
body: <p>I would like to parse a text file with content that looks something like below:</p>
  
  <pre><code>START-OF-DATA
  #100846105
  START SECURITY|US912810DZ85|CBBT|
  ## in: 20150430_14:59:00 to 20150430_15:00:00 [13 (New York-DST)]
  ## out:20150430_14:59:00 to 20150430_15:00:00 [13 (New York-DST)]
  04/30|15:00:00|B|118.640625||| |A|118.703125||| ||
  04/30|14:59:54|B|118.6328125||| |A|118.6953125||| ||
  04/30|14:59:52|B|118.6328125||| |A|118.6953125||| ||
  04/30|14:59:23|B|118.6328125||| |A|118.6953125||| ||
  04/30|14:59:20|B|118.6328125||| |A|118.6953125||| ||
  END SECURITY|US912810DZ85|0|
  #100846111
  START SECURITY|US912810EA26|CBBT|
  ## in: 20150430_14:59:00 to 20150430_15:00:00 [13 (New York-DST)]
  ## out:20150430_14:59:00 to 20150430_15:00:00 [13 (New York-DST)]
  04/30|15:00:00|B|124.75||| |A|124.828125||| ||
  04/30|14:59:55|B|124.75||| |A|124.8203125||| ||
  04/30|14:59:53|B|124.7421875||| |A|124.8203125||| ||
  04/30|14:59:45|B|124.7421875||| |A|124.8125||| ||
  04/30|14:59:43|B|124.7421875||| |A|124.828125||| ||
  04/30|14:59:27|B|124.7421875||| |A|124.8125||| ||
  04/30|14:59:24|B|124.7421875||| |A|124.828125||| ||
  04/30|14:59:22|B|124.7421875||| |A|124.8125||| ||
  04/30|14:59:20|B|124.7421875||| |A|124.828125||| ||
  04/30|14:59:13|B|124.7421875||| |A|124.8125||| ||
  END SECURITY|US912810EA26|0|
  END-OF-DATA
  </code></pre>
  
  <p>Using the code below</p>
  
  <pre><code>string pattern = @"^(START-OF-DATA\r\n)(?&lt;InstrumentsSection&gt;[^\\]*?)(?:(^END-OF-DATA))";
  var expressionMatchColl = regex.Matches(File.ReadAllText(filePath));
              foreach (Match match in expressionMatchColl)
  {
                              string[] instrumentRows = match.Groups["InstrumentsSection"].Value.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
                              instruments = instrumentRows.ToList();
              }
  </code></pre>
  
  <p>I'm able to retrieve each line within the START-OF-DATA and END-OF-DATA section. However, would like to ignore lines that begins with START SECURITY, ## 
  and END SECURITY. Also, would like to group tick values and identifiers (e.g. 100846105, 100846111) in separate groups.</p>
  
  <p>Can someone please advice?</p>