I'm aware that to split by brackets I need to use the \\[
notation, per this thread: Split using a bracket
However, I need to get tokens from both [ and ].
An example string is study[2]
from whcih I need to get the token 2
.
The following gives an Error in Eclipse's Expression Debugger:
"study[2]".split("\\[\\]");
Is there another regexp I should use?