I have a string like this:
[Value1][Value2][Value3][Value4][Value5]
And I need to get the value for each pair of square brackets. There can be 1 pair to a maximum of 5 pairs.
I've tried this:
var regExp = /\[(.*?)\]/
var matches = regExp.exec([A][B]");
console.log(matches[1]);
console.log(matches[2]);
I expect the console to output A and B, however for B I get undefined.