A preg pattern needs a pair of characters that limit the pattern itself. Here, your template is enclosed in the first pair of brackets, and everything else is outside.
Try this:
$body=preg_replace("/(.*)(.*)(.*)/","$2",$body);
It is only a matter of syntax, and there is no guarantee on the template itself, which looks suspicious.
Suppose the text in your example:
preg_match('#(.*?)#s', $text, $match); $inner_text = trim($match[1]);
Matteo iva
source share