Confused with using split with multiple delimiters
<p>I'm practicing reading input and then tokenizing it.
For example, if I have [882,337] I want to just get the numbers 882 and 337. I tried using the following code:</p>

<pre><code>    String test = "[882,337]";
    String[] tokens = test.split("\\[|\\]|,");
    System.out.println(tokens[0]);
    System.out.println(tokens[1]);
    System.out.println(tokens[2]);
</code></pre>

<p>It kind of works, the output is:
(blank line)
882
337</p>

<p>What I don't understand is why token[0] is empty? I would expect there to only be two tokens where token[0] = 882 and token[1] = 337. </p>

<p>I checked out some links but didn't find the answer.</p>

<p>Thanks for the help!</p>