I have the following input fields with name attributes of:

```
carousels['components'][0][0][title]
carousels['components'][0][1][title]
carousels['components'][0][2][title]

carousels['components'][1][0][title]
carousels['components'][1][1][title]
carousels['components'][1][2][title]

carousels['components'][2][0][title]
carousels['components'][2][1][title]
carousels['components'][2][2][title]

```

I am trying to match the final [ number ] eg this part:

```
carousels['components'][2][THIS][title]
carousels['components'][2][THIS][title]
carousels['components'][2][THIS][title]

```

While ignoring the rest

Here is my regex pattern:

```
/(\[[^components\]])+(\[*])/

```

This affects both of the int's within brackets when I just want the last one. This regex also doesn't recognize the specific requirement of the first array key 'component'

Live regex test here:

<http://www.regexpal.com/?fam=94974>