in reply to Anchor parsing

my $link = '<a.*(?=<\/a>)<\/a>';

You likely want my $re = qr{<a(?:(?!</a>).)*</a>}s (negative look-ahead) or something. Doing a positive look-ahead for the thing you're then matching doesn't make any sense.

Or just use the right tool for the job.