Re: RegEx
| From: | Jason Wong | Date: | Mon, 26 May 2003 05:53:44 +0000 |
| Subject: | Re: RegEx | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148954@lists.php.net to get a copy of this message | ||
On Monday 26 May 2003 08:05, Brian V Bonini wrote:
> Trying to pull data from a remote location and extract a certain section
> (and yes I have permission). Can not seem to get this to work:
>
> $siteurl = "http://domain.com";
> $string = file($siteurl);
> $matches = array();
> preg_match_all('|\<\!--***** BEGIN HOME PAGE CONTENT *****
> --\>(.*?)\<\!--***** END HOME PAGE CONTENT ***** --\>|is',$string,
> $matches);
You seem to be escaping the things that doesn't need it and not escaping the
things that do need it.
<, > and ! doesn't need escaping
* needs escaping
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If your aim in life is nothing, you can't miss.
*/