… | |
… | |
47 | =cut |
47 | =cut |
48 | |
48 | |
49 | my $url = |
49 | my $url = |
50 | qr{ |
50 | qr{ |
51 | (?:https?://|ftp://|news://|mailto:|file://|\bwww\.) |
51 | (?:https?://|ftp://|news://|mailto:|file://|\bwww\.) |
52 | [a-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27,~#]* |
52 | [\w\-\@;\/?:&=%\$.+!*\x27,~#]* |
53 | ( |
53 | ( |
54 | \([a-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27,~#]*\)| # Allow a pair of matched parentheses |
54 | \([\w\-\@;\/?:&=%\$.+!*\x27,~#]*\)| # Allow a pair of matched parentheses |
55 | [a-zA-Z0-9\-\@;\/?:&=%\$_+*~] # exclude some trailing characters (heuristic) |
55 | [\w\-\@;\/?:&=%\$+*~] # exclude some trailing characters (heuristic) |
56 | )+ |
56 | )+ |
57 | }x; |
57 | }x; |
58 | |
58 | |
59 | sub on_key_press { |
59 | sub on_key_press { |
60 | my ($self, $event, $keysym, $octets) = @_; |
60 | my ($self, $event, $keysym, $octets) = @_; |