Given the following input:
something_[[foo.bar]]-[[foo.bar[bin=baz]]]something[[foobar]]
I'd like to capture the following substrings (anything between [[ and ]], including single square brackets):
[[foo.bar]]
[[foo.bar[bin=baz]]]
[[foobar]]
This regex gets part of the way there:
/(\[\[.+?\]\])/i
But it only captures the first instance: [[foo.bar]]. How can I make it capture the other two substrings?