Re: Special regular expression
| From: | Art Wells | Date: | Thu, 07 Sep 2000 00:34:30 +0000 |
| Subject: | Re: Special regular expression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15623@lists.php.net to get a copy of this message | ||
On Wed, 6 Sep 2000, Dirk Bonenkamp - Bean IT wrote:
> $unsplitted = "<html><body><? phpstuff
> ?></body></html>";
>
> $splitted = desired_function("<?", "?>", $unsplitted");
>
> This then should result in:
>
> $splitted[0] = "<html><body>"
> $splitted[1] = "<? phpstuff ?>"
> $splitted[2] = "</body></html>"
I suggest trying
preg_match("/(.*)(<\?.*\?>)(.*)/",$unsplitted,$splitted);
or would it be
preg_match("/(.*)(\<\?.*\?\>)(.*)/",$unsplitted,$splitted);
Either one might be close, but note it will produce:
$splitted[1] = "<html><body>"
$splitted[2] = "<? phpstuff ?>"
$splitted[3] = "</body></html>"
http://www.artwells.com/
That which indicates nothing
introduces everything.