title: Split at multiple delimiter without delimiter in the list
body: <p>This should be an really easy task using the <code>re</code> library. However, I can't seem to split my string at the delimiters <code>]</code> and <code>[</code>.</p>
  
  <p>I already read <a href="https://stackoverflow.com/questions/10393157/splitting-a-string-with-multiple-delimiters-in-python">Splitting a string with multiple delimiters in Python</a>, <a href="https://stackoverflow.com/questions/4998629/python-split-string-with-multiple-delimiters">Python: Split string with multiple delimiters</a>, and <a href="https://stackoverflow.com/questions/9403275/python-how-to-get-multiple-elements-inside-square-brackets">Python: How to get multiple elements inside square brackets</a>.</p>
  
  <p>My string:</p>
  
  <pre><code>data = "This is a string spanning over multiple lines.
          At somepoint there will be square brackets.
  
          [like this]
  
          And then maybe some more text.
  
          [And another text in square brackets]"
  </code></pre>
  
  <p>It should return:</p>
  
  <pre><code>['This is a string spanning over multiple lines.\nAt somepoint there will be square brackets.','like this', 'And then maybe some more text.', 'And another text in square brackets']
  </code></pre>
  
  <p>A short example to try:</p>
  
  <pre><code>data2 = 'A new string. [with brackets] another line [and a bracket]'
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>re.split(r'(\[|\])', data2)
  re.split(r'([|])', data2)
  </code></pre>
  
  <p>But those would either result in having the delimiter in my resulting list or a wrong list altogether:</p>
  
  <pre><code>['A new string. ', '[', 'with brackets', ']', ' another line ', '[', 'and a bracket', ']', '']
  </code></pre>
  
  <p>Result should be:</p>
  
  <pre><code>['A new string.', 'with brackets', 'another line', 'and a bracket']
  </code></pre>
  
  <p>As a special requirement all newline characters and white spaces before and after a delimiter should be removed and not be included in the list either.</p>