title: Python: How to get multiple elements inside square brackets
body: <p>I have a string/pattern like this:</p>
  
  <pre><code>[xy][abc]
  </code></pre>
  
  <p>I try to get the values contained inside the square brackets:</p>
  
  <ul>
  <li>xy</li>
  <li>abc</li>
  </ul>
  
  <p>There are never brackets inside brackets. Invalid: <code>[[abc][def]]</code></p>
  
  <p>So far I've got this:</p>
  
  <pre><code>import re
  pattern = "[xy][abc]"
  x = re.compile("\[(.*?)\]")
  m = outer.search(pattern)
  inner_value = m.group(1)
  print inner_value
  </code></pre>
  
  <p>But this gives me only the inner value of the first square brackets.</p>
  
  <p>Any ideas? I don't want to use string split functions, I'm sure it's possible somehow with RegEx alone.</p>