So I have this regex: /.+\[[0-9]+\]/g
and this string hello[0][1][3]
And I am trying to split that into - hello[0]
, hello[0][1]
and hello[0][1][3]
using regex.exec(...)
but I am getting hello[0][1][3]
as the only match.
How can I modify the regular expression to get the desired result