in reply to Fetching meta tag info

How about:
if($line =~ /<meta name=".*?author"\s+content="([^>]*)"/i)
Neil Watson
watson-wilson.ca

Replies are listed 'Best First'.
Re: Re: Fetching meta tag info
by rasta (Hermit) on Nov 12, 2002 at 15:37 UTC
    It it possible to have spaces besides equel sign, and quotes isn't mandatory in some cases. So, I suggest the following:
    if($line =~ /<meta name\s*=\s*"?.*?author"?\s+content\s*=\s*"?([^>"]*) +"?/i)
      Thanks!

      ? I am Lost on what the numberous question marks are doing in this req expression?
        :-)
        A quote from the perlre man page:
          ? - Match 1 or 0 times
        
        PS. You are welcome :-)
        :-) A quote from the perlre man page:

          ? - Match 1 or 0 times

        PS. You are welcome :-)