in reply to Help with regs

Don't use a regex. Use HTML::TokeParser::Simple and URI::Find (or URI::Find::Schemeless) instead. The HTML::TokeParser::Simple documentation has examples of very similar cases you can adapt. The core loop would look something like this:
my $finder = URI::Find::Schemeless->new(sub { my ($uri, $text) = @_; return qq{<a href="@{[ $uri->abs() ]}">$text</a>}; }); my HTML::TokeParser::Simple->new(\*STDIN); while (my $token = $p->get_token) { my $text = $token->as_is; $finder->(\$text) if $token->is_text; # here's the key print $text; }
The key line invokes URI::Find::Schemeless only for tokens which are plaintext, not part of a tag or other things.

Makeshifts last the longest.