ed33ab4953c6848db146c2d72873a8346527a878
[debian/pino.git] / debian / patches / 006_improve-url-regex.diff
1 Description: Improve the regex used for URLs
2 Author: Julien Valroff <julien@kirya.net>
3 Forwarded: yes
4 Bug: http://code.google.com/p/pino-twitter/issues/detail?id=277
5
6 --- a/src/template.vala
7 +++ b/src/template.vala
8 @@ -62,7 +62,7 @@
9                 nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
10                 tags = new Regex("(^|\\s)#([A-Za-z0-9_-\\p{Latin}\\p{Greek}]+)");
11                 groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
12 -               urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
13 +               urls = new Regex("((https?|ftp)://([A-Za-z0-9+&@#/%?=~_|!:,.;-]*)([A-Za-z0-9+&@#/%=~_|$]))"); // still needs to be improved for urls containing () such as wikipedia
14                 
15                 // characters must be cleared to know direction of text
16                 clear_notice = new Regex("[: \n\t\r♻♺]+|@[^ ]+");