On Fri, Aug 10, 2001 at 01:29:26PM -0400, Kyle Mathews wrote:
> 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.


This is for an exact match of your example above:
preg_match ("/<META[^>]+CONTENT=\"([^\"]+)\"/", $string, $matches)

If you don't know if it's in upper and/or lower case:
preg_match ("/<meta[^>]+content=\"([^\"]+)\"/i", $string, $matches)


-- 

* R&zE:

-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
-- H: +31 23 5516190
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
--
-- http://www.datalink.nl
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to