|
Posted by NC on 02/28/07 22:24
On Feb 28, 10:03 am, "Damo" <cormacdeba...@gmail.com> wrote:
>
> I'm using this regular expression at the moment
>
> $regexp = "%<table cellspacing=\"0\" cellpadding=\"0\"> (.+) <img
> height=\"1\" alt=\"Today's News\" />%s";
>
> Each news story is in between those tags , So if I extract those
> chunks of html using
>
> preg_match($regexp,$document,$matches);
>
> where $document is a handle on the file. I can store them in %matches
> for further processing. Alas it does not work
How exactly does it not work? What gets into $matches and what value
does
preg_match() return?
> Can anyone help?
First, do you really need the whitespace around (.+)? Second,
$document
must be a string, not a handle on the file. Third, your regular
expression
as written is greedy; is this intentional?
Cheers,
NC
Navigation:
[Reply to this message]
|