title: Regular Expression to find brackets in a string
body: <p>I have a string which has multiple brackets. Let says</p>
  
  <pre><code>s="(a(vdwvndw){}]"
  </code></pre>
  
  <p>I want to extract all the brackets as a separate string. </p>
  
  <p>I tried this: </p>
  
  <pre><code>&gt;&gt;&gt; brackets=re.search(r"[(){}[]]+",s)
  &gt;&gt;&gt; brackets.group()
  </code></pre>
  
  <p>But it is only giving me last two brackets. </p>
  
  <pre><code>'}]'
  </code></pre>
  
  <p>Why is that? Shouldn't it fetch one or more of any of the brackets in the character set?</p>