I'm trying construct preg_match_all to search for all the values found in a string that begins with [$_ and ends with _$], and store the found values in an array.
So, in the following example:
$str = "I have a [$_dog_$], a [$_cat_$], but not a ferret.";
preg_match_all($regex_pattern, $str, $normalPets);
$normalPets should contain [$_dog_$] and [$_cat_$].
What is the $regex_pattern for this?
Thanks