title: Java Regexp: Split by both brackets
body: <p>I'm aware that to split by brackets I need to use the <code>\\[</code> notation, per this thread: <a href="https://stackoverflow.com/questions/8141698/split-using-a-bracket">Split using a bracket</a></p>
  
  <p>However, I need to get tokens from both [ and ].</p>
  
  <p>An example string is <code>study[2]</code> from whcih I need to get the token <code>2</code>.</p>
  
  <p>The following gives an Error in Eclipse's Expression Debugger:</p>
  
  <pre><code>"study[2]".split("\\[\\]");
  </code></pre>
  
  <p>Is there another regexp I should use?</p>