Re: Meta Tags and Regular Expressions
| From: | Richard Lynch | Date: | Sun, 12 Aug 2001 21:44:49 +0000 |
| Subject: | Re: Meta Tags and Regular Expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62344@lists.php.net to get a copy of this message | ||
You do realize there is a PHP function for that
http://php.net/get_meta_tags, I think...
It will not work properly on oddly-formatted META tags, though... Go fit
it, after you figure out the right Regex expressions.
You'll want the non-greedy Regex (POSIX or Perl, I forget which is which).
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Kyle Mathews <kyle@thedip.net>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Friday, August 10, 2001 12:29 PM
Subject: Meta Tags and Regular Expressions
> Hello:
>
> I'm looking for a good way to pull information from a static HTML file for
> dumping into a database.
> I need to pull the information from a META tag, and from within two
comments
> in the HTML file.
> I know this can be done with regular expressions, but I'm not really sure
> where to start or how to do it.
>
> <META name="CATEGORY" CONTENT="Test Content">
>
> I need to pull the CONTENT information from this META tag.
>
> <!-- STORY START -->
>
> Story contents
>
> <!-- STORY END -->
>
> Then pull the information from between these two comments.
>
> Any help, and/or example code would help a lot.
>
> Thanks,
> Kyle
> kyle@thedip.net
>
>
>