I wrote a regular expression which I expect should work but it doesn\'t.
var regex = new RegExp(\'(?<=\\[)[0-9]+(?=\\])\')
Javascript
Lookahead is supported, but not lookbehind. You can get close, with a bit of trickery.