use Digest::SHA qw/sha1_hex/;
my $SALT = rand;
-my $LINK_RE = qr!\b((?:ftps?|https?|nntps?|gopher)://
+my $LINK_RE = qr{\b((?:ftps?|https?|nntps?|gopher)://
[\@:\w\.-]+/
- ?[,:~\$\@\w\+\&\?\.\%\;/#=-]*)!x;
+ (?:[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]*)
+ (?:\?[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%]+)?
+ (?:\#[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%\?]+)?
+ )}xi;
sub new { bless {}, shift }