I need a function that returns all substrings between a regex expression that matches anything and a delimiter.
$str = "{random_one}[SUBSTRING1] blah blah blah {random_two}[SUBSTRING2] blah blah blah{random_one}[SUBSTRING3]";
$resultingArray = getSubstrings($str)
$resultingArray should result in:
array(
[0]: "SUBSTRING1",
[1]: "SUBSTRING2",
[2]: "SUBSTRING3"
)
I've been messing with regex with no luck. Any help would be greatly appreciated!
$matches[1]