This is a fast question, I just don't know many Regex tricks and can't find documentation for this exact point:
Lets say I have the string:
'I know [foo] and [bar] about Regex'
I want to do a JS Regex pattern that makes an array of each bracket encapsulation. Result:
['[foo]', '[bar]']
I currently have:
str.match(/\[(.*)\]/g);
But this returns:
'[foo] and [bar]'
Thanks.