I have a string that looks something like this:

```
"something[something][0][]"

```

What I need to do is replace the `[0]` with another number. This is what I've attempted:

```
var name = nameVar.replace(/[^\[\]]+(?=\]\[[^\]]+\]$)/, "999");

```

Any help on the regex expression ?