I'm very new to regular expressions, can you tell me the preg_match solution for string printed below?
{foreach $gobar}
Anything here
{/foreach}
Thanks.
/\{foreach \$gobar\}\s+(.*)\s+\{\/foreach\}/
reference:
http://www.regular-expressions.info/anchors.html
http://www1.cs.columbia.edu/~lennox/perlre.html
if (preg_match('#\{foreach \$gobar\}
(.*)
\{\/foreach\}#', $yourData, $matches)) {
echo $matches[1]; // "Anything here"
}