Hello. I made a module. It's at http://the.earth.li/~kake/URI-Find-Wrapped-0.01.tar.gz (for now).
This is what it does (see its pod for more): ---------------------------------------------------------------------- DESCRIPTION Works like URI::Find, but is prepared for URIs in your text to be wrapped in a pair of delimiters and optionally have a title. This will be useful for processing text that already has some minimal markup in it, like bulletin board posts or wiki text. SYNOPSIS my $finder = URI::Find::Wrapped->new; my $text = "This is a [http://the.earth.li/ titled link]."; $finder->find(\$text); print $text; ---------------------------------------------------------------------- My questions for you: - How does it look? - Is there a better name for it? - Anyone feel like sending documentation patches and/or extra tests? - Any suggestions for getting the following test to pass? (At the moment it fails because the trailing ']' is getting assumed to be the end of the URL; I'm using ($close_re?) to match the closing delimiter because I don't want to force it to be there. What I really want is something that can force it to be there if and only if the opening delimiter was found, but I'm not allowed to do variable-width look-behind assertions.) ---------------------------------------------------------------------- use Test::More tests => 1; use URI::Find::Wrapped; my $finder = URI::Find::Wrapped->new; my $text = "[http://use.perl.org/]"; $finder->find(\$text); is( $text, qq|[<a href="http://use.perl.org/">http://use.perl.org/</a>]|, "wrapped URIs are found even if no title" ); ---------------------------------------------------------------------- Kake