Re: Help with ereg()
| From: | fLIPIS | Date: | Wed, 12 Mar 2003 15:48:44 +0000 |
| Subject: | Re: Help with ereg() | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139321@lists.php.net to get a copy of this message | ||
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:
<? echo "aaa"; ?><html><? echo "bbb"; ?>
And now it only takes the text between <? and ?>, even multilined code.