title: Python regex: excluding square brackets and the text inside
body: <p>I am trying to write a regex that excludes square brackets and the text inside them.</p>
  
  <p>My sample text looks like this: <code>'WordA, WordB, WordC, [WordD]'</code></p>
  
  <p>I want to match each text item in the string except <code>'[WordD]'</code>. I've tried using a negative lookahead, something like... <code>[A-Z][A-Za-z]+(?!\[[A-Z]+\])</code> but doing so is still matching the text inside the brackets.</p>
  
  <p>Is negative lookahead the best approach? If so, where am I going wrong?</p>