title: Regular expression to split a string (which contains newline characters) into equal length chunks
body: <p>I have got a string let's say
  Test Subject\r\nTest Comments...
  I want to write a regular expression which would split the string to chunks of n characters say n=6 and the split process should not be affected by newline characters (\r\n).</p>
  
  <p>The code which i have come up with is </p>
  
  <pre><code>string pattern = ".{1," + 6 + "}";
  string noteDetails = "Test Subject\r\nTest Comments...";
  List&lt;string&gt; noteComments = Regex.Matches(noteDetails, pattern).Cast&lt;Match&gt;().Select(x =&gt; x.Value).ToList();`
  </code></pre>
  
  <p>But the output which i am getting is</p>
  
  <pre><code>Test S
  ubject
  
  Test C
  omment
  s...
  </code></pre>
  
  <p>The desired output is</p>
  
  <pre><code>Test S
  ubject
  \r\nTe
  st Com
  ments.
  ..
  </code></pre>
  
  <p>If \r\n is not present then the code works fine. The bottom line is \r\n should also be considered as normal characters.</p>
  
  <p>Thanks in advance</p>