#!/usr/bin/perl while(<DATA>) { m#<A.*?HREF=(?:'|")?(.[^\'\"]+)(?:'|")?(?:\s.+)?>(.*?)</A>#ig; print "URL: $1\nName: $2\n\n"; } __END__ <A HREF=?ad=049>One</A> <A HREF=?ad=050>Two</A> <a target='_new' href='foo'>foo --> bar</a> <a target='_new' href='boo'>blah</a> <a target='_new' href=bar>troz</a> <a target='_new' href=bar2 onclick='somefunc'>troz</a> <a target='_new' href='bar3' onclick='somefunc'>troz</a>
In reply to Re: extracting link *and* tag content from "a href"
by bageler
in thread extracting link *and* tag content from "a href"
by hmerrill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |