in reply to regex not matching how I want it to :(
I would very much recommend not parsing HTML with regular expressions - see Parsing HTML/XML with Regular Expressions. For example, see HTML::LinkExtor:
use HTML::LinkExtor; my $p = HTML::LinkExtor->new(); $p->parse_file("test.html"); my @hrefs = map { {@$_[1..$#$_]}->{href} } $p->links;
On your sample data, @hrefs is ("test1.htm", "test2.htm", "test3.htm").
|
|---|