I need to aggregate an array of objects. I would assume using RegEx to collect all instances of text that are surrounded by square brackets would be the ideal method. (see example below).
Can someone please explain how I would read through the text to execute the above?
$links = some [[text]] here and another [[link]] here
So $links[0] should equal [[text]]
This pattern will get you the text inside double brackets as the inner groupings, and the the outer brackets included, as the full pattern match:
So you can use whichever one you need.