I wrote a regular expression which I expect should work but it doesn\'t.
var regex = new RegExp(\'(?<=\\[)[0-9]+(?=\\])\')
Javascript
This should work:
var regex = /\[[0-9]+\]/;
var regex = /\[([0-9]+)\]/;
With this expression, you could do something like this:
var matches = someStringVar.match(regex); if (null != matches) { var num = matches[1]; }