The key line invokes URI::Find::Schemeless only for tokens which are plaintext, not part of a tag or other things.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; }
Makeshifts last the longest.
In reply to Re: Help with regs
by Aristotle
in thread Help with regs
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |