title: Ruby regex for text within parentheses
body: <p>I am looking for a regex to replace all terms in parentheses unless the parentheses are within square brackets.</p>
  
  <p>e.g.</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>(matches) #match
  [(do not match)] #should not match
  [[does (not match)]] #should not match
  </code></pre>
  
  <p>I current have:</p>
  
  <pre><code>[^\]]\([^()]*\) #Not a square bracket, an opening bracket, any non-bracket character and a closing bracket.
  </code></pre>
  
  <p>However this is still matching words within the square brackets.</p>
  
  <p>I have also created a rubular page of my progress so far:  <a href="http://rubular.com/r/gG22pFk2Ld" rel="nofollow">http://rubular.com/r/gG22pFk2Ld</a></p>