keyWords = {}

completeHtmlPage.scan( /<meta\s+name="keywords"\s+content="([^"]+)"/i ) do
|m|
  $1.strip.split( /\s*,\s*/ ).each |kw|
    keyWords[ kw ] = true
  end
end

keyWords.keys.sort do |kw|
  puts kw
end

or so

    robert

"Cedric Foll" <cedric.foll / ac-rouen.fr> schrieb im Newsbeitrag
news:pan.2003.04.29.14.41.01.599662 / ac-rouen.fr...
> Hi,
>
>
> I'd like to get all the keywords in a html page defined like this one:
> <meta name="keywords" content="wallpaper, sex, kostenlose, high quality,
desktop">
> In this example, kewords are "wallpaper, sex, kostenlose, high quality,
desktop"
>
> The pb is when there are more than one <meta name="keyword" content=...>
> in the page.
> How can i get all ?
>
> With Perl, something like
>  while (/regexp/g) {
> #do smt with $1
> }
> works.
>
> How can I do that with Ruby ?
>
> Regards.