<?php
$str="table v table table e table table zalwel name=grid table table iets table  table iet table";
echo $str. "<br><br>" . PHP_EOL;
$subject = $str;
$pattern =  '/((table.*?table ?)*) (table.*?name=grid.*?table) (table.*table)*/';
preg_match($pattern, $subject, $matches);
print $matches[1] . "<br>";
print $matches[2] . "<br>";
print $matches[3];
?>


geeft

table v table table e table
table e table
table zalwel name=grid table

ik zou de 2e zin uit de output willen halen. Zou andere paranthis kunnen oid?

Wie weet dit?

Reageren