--- rxvt-unicode/src/perl/selection 2006/01/03 21:08:39 1.9 +++ rxvt-unicode/src/perl/selection 2006/01/05 01:07:31 1.12 @@ -10,13 +10,16 @@ } my @patterns = ( - # urls - qr{ ([a-z0-9.+\-]+://[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),]+) }x, + # urls, just a heuristic + qr{( + (?:https?|ftp|news|mailto|file)://[ab-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27(),~]+ + [ab-zA-Z0-9\-\@;\/?:&=%\$_+!*\x27(),~] # do not include a trailing dot, its wrong too often + )}x, # shell-like argument quoting - qr{\G\s*( + qr{\G [\ \t|&;<>()] *( (?: - [^"'\\ \t]+ + [^\\"'\ \t|&;<>()]+ | \\. | " ([^\\"]+ | \\. )* " | ' [^']* '