¡¡¡¡¡¡¡¡¡¡¡ Got it !!!!!!!!!!
It even matches the linebreaks, so it can color multi-line code. Look at
this sample:

------------- TEXT TO USE FOR SEARCHING
PATTERNS ------------------------------

<? phpinfo(); ?>
<?
echo "PHP IS A GREAT PROGRAMMING LANGUAGE";
?>
<?

// :-)
mysql_connect("localhost","root","big_brother_is_watching");


?>

-------------------------- END
TEXT -------------------------------------------------------

Script used to get all of the matches:

preg_match_all("/(<\?.*\?>)/ims",$HebraPadre["texto"],$codigo_fuente_padre);

echo "<pre>";
echo highlight_string($codigo_fuente_padre[1][0], TRUE);
echo highlight_string($codigo_fuente_padre[1][1], TRUE);
echo highlight_string($codigo_fuente_padre[1][2], TRUE);
echo "</pre>";

And it works quite OK
I removed the (\ at the beginning, and added the "s" to the end.

Thanks, without your tip I was real lost. It was while reading this

http://php.benscom.com/manual/es/pcre.pattern.syntax.php

that i realized how to do it.

Thanks very much

fLIPIS



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to