javascript regex to match number square brackets and get the remaining string : I have a string like following 

    value[0]

1. I want to check if `str contains square brackets`.
2. If yes than get the number which in above case is `0` 
3. Get the rest of the string without brackets and number which in above case is `value`

>      var matches = this.key.match('/[([0-9]+)]/');  // 1 
>       if (null != matches) {
>         var num = matches[1]; // 2
>       }

How to get 3 point accomplished ?

