First of all, I’m not sure you need i flag
Secondly, if you’re using range selector [...] then you need to specify how much character within the range you want to match, for example [\[\]]+ will match from one to unlimited amount of characters.
I am pretty sure that a string-based solution isn’t how this challenge was intended to be answered, but I am tickled at the ingenuity of the solution. You might need to strip out extra commas too.
This solution will have a problem with empty arrays, as after removing brackets you will have something like this: "1, , 3, 4" with one unnecessary comma