Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Link script adjustment needed
by chromatic (Archbishop) on Feb 26, 2002 at 20:33 UTC
    You have several options. Forbid spaces. Forbid double quote marks. Remove the closing angle bracket in your regular expression.

    In the interests of efficiency and efficacy, merlyn has written link verifiers. See his homepage. You might also have better luck with a module such as HTML::Parser or HTML::TokeParser, which can provide the 'href' attribute of an 'a' tag.

    For reading this far, here's a regex I'd try for a quick and dirty solution:

    $buf =~ /<a href="([^"])"/gis

      I tried $buf =~ /<a href="([^"])"/gis and it didnt print anything. I also cant seem to find the merlyn link verification script. I was hoping someone could help me modify what I have if that is possible? Thanks
Re: Link script adjustment needed
by johanvdb (Beadle) on Feb 26, 2002 at 20:35 UTC
    Hi,

    Have you tried the package HTML::LinkExtor yet? It is specially designed to extract links (href, src) etc ... from HTML pages.

    Just do a 'perldoc HTML::LinkExtor' to find a nice example on how to use it ... ;-)

    J.