in reply to lookaround assertions
If this isn't a one off I'd really look into HTML::PARSER . It makes retrieving tag attributes quite simple. And it's designed to do this job. Of course it could be overkill, but I tend to think the Module use makes for more readable code than regex abuse.
In Section
Seekers of Perl Wisdom