title: How to split a string enclosed with "{}" and "[]" using regex expression
body: <p>Can anyone help me the Regular expression for the string like this</p>
  
  <pre><code>string input = {TEXT}_&amp;[2].&amp;[1].&amp;[3];
  input = {TEXT}_&amp;[2].&amp;[1];
  </code></pre>
  
  <p>I wanted to split the string as</p>
  
  <pre><code>TEXT
  2
  1
  3
  
  TEXT
  2
  1
  </code></pre>
  
  <p>I have got a regular expression which is splitting the square bracket content but i need a regex to match curly braces also</p>
  
  <pre><code>string pattern = @"\{([^]]*)\}";  //to get only curly brace content
  string pattern = @"\[([^]]*)\]";  //to split square bracket content.
  </code></pre>
  
  <p>I need single pattern to split both</p>