title: Regular Expression to split a string with parentheses
body: <p>Need help with RegEx. Using C#.</p>
  
  <p>Group of Words in parentheses (round or box or curly) should be considered as one word. The part, which is outside parentheses, should split based on white space ' '.  </p>
  
  <p>A) Test Case – </p>
  
  <p>Input - <code>Andrew. (The Great Musician) John Smith-Lt.Gen3rd</code></p>
  
  <p>Result (Array of string) –<br>
  1. Andrew.<br>
  2. The Great Musician<br>
  3. John<br>
  4. Smith-Lt.Gen3rd </p>
  
  <p>B) Test Case – </p>
  
  <p>Input - <code>Andrew. John</code></p>
  
  <p>Result (Array of string) –<br>
  1. Andrew.<br>
  2. John </p>
  
  <p>C) Test Case – </p>
  
  <p>Input - <code>Andrew {The Great} Pirate</code></p>
  
  <p>Result (Array of string) –<br>
   1. Andrew<br>
   2. The Great<br>
   3. Pirate   </p>
  
  <p>The input is name of a person or any other entity. Current system is very old written in Access. They did it by scanning character by character. I am replacing it with C#.</p>
  
  <p>I thought of doing it in two steps – first parentheses based split and then word split. </p>
  
  <p>I wanted to throw these cases out as bad input -  </p>
  
  <ol>
  <li><p>Only Starting or ending parentheses available</p></li>
  <li><p>nested parentheses</p></li>
  </ol>
  
  <p>Overall, I wanted to split only well-formed (if start parentheses is there, there must be an ending) Inputs only.</p>