I´m really new to regex and I have been looking around to find an answer but either it dont work or I get some kind of error so I will try to ask the question and hopefulyl some
you could do it with match in one shot, and get an array back.
below lines were tested in chrome console:
str = "car[brand=saab][wheels=4]"; "car[brand=saab][wheels=4]" str.match(/[^=[\]]+(?=[[\]])/g) ["car", "saab", "4"]