No, actually i was wrong about this subject. The correct Regular Expression
for this is the following:
preg_match_all("/(<\?.*?\?>)/ims",$text,$source_code);
The anterior was greedy, and so it matched the following:
And now it only takes the text between , even multilined code.
--
PHP Gene
¡¡¡ Got it !!
It even matches the linebreaks, so it can color multi-line code. Look at
this sample:
- TEXT TO USE FOR SEARCHING
PATTERNS --
-- END
TEXT ---
Scri
Use preg_match_all();
Something like preg_match_all("/(\(<\?.*\?>)/im", $Text, $Array_PHP_Code,
PREG_PATTERN_ORDER); should do it. It might need some work, but you'll get
it. :)
Niklas
-Original Message-
From: Alejandro [mailto:[EMAIL PROTECTED]
Sent: 11. maaliskuuta 2003 14:59
To: [E
3 matches
Mail list logo