I’m trying to build out a preg_match_all so I can use the array, but the problem is that I can’t refine my regex to work.
An example input would be:
#|First Name|#
This text shouldn't be caught
#|Second Value|#
First Name and Second Value should both be in the array.
Here’s what I’ve tried:
preg_match_all('/\#\|(.*?)\|\#\]/',$html, $out);
and
preg_match_all ("/^#\|*\|#*$/i", $html, $out);
The first is about right, it only contains
\]near the end which breaks what you want. Usingdoes give me correct results, with the matches in
$out[1].