Gracias pateketrueke.. funciono a la perfeccion con el \s* ^^
Código HTML:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>testing</title>
</head>
<body style="font-family: Lucida Sans Unicode; font-size: 11px;">
hola <$Name> <$LastName> como estas?!!
<br/>
<if $Name==$Name>
if:1
<if $Name==$LastName>
if:2
</if>
<else>
else:2
</else>
</if>
<else>
else:1
</else>
</body>
</html>
Fragmento..
Código php:
Ver originalfunction ifParser($matches)
{
$ifCatcher='%<if\s*(.+)>((?:[^<]|(?R))+)</if>\s*(?:<else>((?:[^<]|(?R))+)</else>)?%';
{
preg_match('%(.+)([^\w]+[==|!=|<=|>=|<|>|&&|\|\|]+)(.+)%', $matches[1], $c0nd);
if(substr($c0nd[1], 0, 1)=='$') $c0nd[1]="'".$this->_var
[substr($c0nd[1], 1)]."'"; if(substr($c0nd[3], 0, 1)=='$') $c0nd[3]="'".$this->_var
[substr($c0nd[3], 1)]."'";
$cond=$c0nd[1].$c0nd[2].$c0nd[3];
$_eval='if('.$cond.') $matches=$matches[2]; else $matches=$matches[3];';
}
}
Lo que si no funciona si pongo otras etiquetas dentro del if o else, estoy viendo como hacerlo, despues si me sale modifico el codigo
Saludos