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
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