Gossamer Forum
Home : General : Perl Programming :

Regular Expression Help

Quote Reply
Regular Expression Help
Hi,

I am having trouble writing a regular expression to get the contents of meta tags from a page.

Here's what I use now
$results =~ m/\s?name="keywords"?.?content=\"([^>]*)\">/isg

And it doesn't extract keywords from time to time. Sometimes because they are written like
name="keywords"
content="asda"
and sometimes for no apparent reason.

Can someone help me with a better regexp that will be able to handle different ways people can write <meta name="keywords" content="asd">?

Or if someone can point me to a script that does something similar?
thanks in advance

------------------
Greg L
gregl@email.com
www.GLdev.com


Subject Author Views Date
Thread Regular Expression Help GL 3384 Aug 13, 1999, 8:29 AM
Post Re: Regular Expression Help
Eliot 3238 Aug 13, 1999, 8:43 AM
Post Re: Regular Expression Help
GL 3237 Aug 13, 1999, 11:06 AM
Post Re: Regular Expression Help
Eliot 3233 Aug 13, 1999, 12:07 PM