You are here: Re: PHP and regular expressions « PHP Programming Language « IT news, forums, messages
Re: PHP and regular expressions

Posted by BKDotCom on 02/28/07 21:25

__where $document is a handle on the file__
the 2nd parameter should be a string
read the file to a string...

Do you really want the space around "(.+)" ?
you can clean this up by enclosing it in '' rather than ""
$regexp = '%<table cellspacing="0" cellpadding="0"> (.+) <img
height="1" alt="Today's News" />%s';

On Feb 28, 12:03 pm, "Damo" <cormacdeba...@gmail.com> wrote:
> Hi,
> I'm new to this group and regular expressions. I want to extract text
> from a newspaper website using regular expressions and php
> 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 and i cannot figure out
> why
>
> Can anyone help?
> Thanks

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация