using System.Diagnostics;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public static void Main()
Stopwatch sw = new Stopwatch();
using (StringReader reader = new StringReader(text))
Console.WriteLine(i.ToString() + ".");
string line = string.Empty;
while( (line = reader.ReadLine()) != null)
if(string.IsNullOrWhiteSpace(line))
Console.WriteLine(i.ToString() + ".");
elapsed = sw.ElapsedTicks;
Console.WriteLine("my method took : " + elapsed);
MatchCollection findings = new Regex(@"((.|(\n.))+)|((\n\n)((.|(\n.))+))").Matches(text);
for(int i = 0; i < findings.Count; i++) {
int groupIndex = findings[i].Groups[1].Length > 0 ? 0 : 6;
string match = findings[i].Groups[groupIndex].ToString();
Console.WriteLine(i+".");
Console.WriteLine(match);
elapsed = sw.ElapsedTicks;
Console.WriteLine("your method took : " + elapsed);