Hallo,
vielleicht habe Dich mißverstanden, aber spricht etwas gegen diese Lösung?:
<?php
$str1 = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <!--{F-filetime(-10)}-->Nunc odio augue.';
$str2 = '<!--{T-mainmenu}-->';
$str3 = '<!--{L-self}-->';
$str4 = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. <!--{F-filetime(-10)}-->Nunc odio augue. <!--{T-mainmenu}--> <!--{L-self}-->';
$pattern = '/<!--{(?:.*?)(L|M|F|T)-([a-z]+)(?:(([0-9-]+)))?}-->/msi';
preg_match($pattern, $str1, $matches1);
preg_match($pattern, $str2, $matches2);
preg_match($pattern, $str3, $matches3);
preg_match_all($pattern, $str4, $matches4, PREG_SET_ORDER);
while(list($key,$val) = each($matches1)) { echo $key.' = '.$val.'<br />'; }
echo '<hr />';
while(list($key,$val) = each($matches2)) { echo $key.' = '.$val.'<br />'; }
echo '<hr />';
while(list($key,$val) = each($matches3)) { echo $key.' = '.$val.'<br />'; }
echo '<hr />';
while(list(,$match) = each($matches4)) { while(list($key,$val) = each($match)) { echo $key.' = '.$val.'<br />'; } }
echo '<hr />';
?>
Ciao,
Andreas