title: how to split string using regex
body: <p>I'd like to split a string with using pattern like this: </p>
  
  <p>it starts and ends with '\n' and contains an arbitrary number of whitespace or '\n' in between. </p>
  
  <p>Edit:</p>
  
  <p>This input: </p>
  
  <pre><code>string s = "aaa\n    \nbbb\n    \nccc\n   \n   \nddd"; 
  </code></pre>
  
  <p>should result in an array containing</p>
  
  <pre><code>aaa
  bbb
  ccc
  ddd
  </code></pre>