]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Linkify.pm
www: implement generic help text
[public-inbox.git] / lib / PublicInbox / Linkify.pm
index 25f0b48a34d9b2329b97d857797476f474e7632a..ea7fd71f13ca6d7f8a0909b271be95a03be1b2aa 100644 (file)
@@ -15,9 +15,12 @@ use warnings;
 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 }