title: RegEX match everything outside square brackets
body: <p>I'm playing around with the WP editor and I'd like to create a RegEX pattern that matches everything outside the square brackets like this:</p>
  
  <pre><code>[foo]Some selected text here[/foo]More selected text here
  </code></pre>
  
  <p>And replace with</p>
  
  <pre><code>[foo][text_box text="Some selected text here"][/textbox][/foo]
  [text_box text="More selected text here"][/textbox]
  </code></pre>
  
  <p>I managed to match the square brackets content using</p>
  
  <pre><code>(\[(.*?)\])
  </code></pre>
  
  <p>How can I match everything else?</p>
  
  <p>Thank you very much for your help!</p>