Improve search regex
authorJulien Valroff <julien@kirya.net>
Wed, 2 Jun 2010 18:42:07 +0000 (20:42 +0200)
committerJulien Valroff <julien@kirya.net>
Wed, 2 Jun 2010 18:42:07 +0000 (20:42 +0200)
debian/patches/003_fix-search-regex.diff
debian/patches/006_improve-url-regex.diff

index 9202447..9344fdd 100644 (file)
@@ -10,7 +10,7 @@ Forwarded: yes
                //compile regex
                nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
 -              tags = new Regex("((^|\\s)\\#[A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
                //compile regex
                nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
 -              tags = new Regex("((^|\\s)\\#[A-Za-z0-9_\\p{Latin}\\p{Greek}]+)");
-+              tags = new Regex("(^|\\s)#([A-Za-z0-9_-\\p{Latin}\\p{Greek}]+)");
++              tags = new Regex("(^|\\s|'|\\()#([A-Za-z0-9_-\\p{Latin}\\p{Greek}]+)");
                groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
                urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
                
                groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
                urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
                
index ed33ab4..5015bae 100644 (file)
@@ -7,7 +7,7 @@ Bug: http://code.google.com/p/pino-twitter/issues/detail?id=277
 +++ b/src/template.vala
 @@ -62,7 +62,7 @@
                nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
 +++ b/src/template.vala
 @@ -62,7 +62,7 @@
                nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
-               tags = new Regex("(^|\\s)#([A-Za-z0-9_-\\p{Latin}\\p{Greek}]+)");
+               tags = new Regex("(^|\\s|'|\\()#([A-Za-z0-9_-\\p{Latin}\\p{Greek}]+)");
                groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
 -              urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
 +              urls = new Regex("((https?|ftp)://([A-Za-z0-9+&@#/%?=~_|!:,.;-]*)([A-Za-z0-9+&@#/%=~_|$]))"); // still needs to be improved for urls containing () such as wikipedia
                groups = new Regex("(^|\\s)!([A-Za-z0-9_]+)"); //for identi.ca groups
 -              urls = new Regex("((http|https|ftp)://([\\S]+))"); //need something better
 +              urls = new Regex("((https?|ftp)://([A-Za-z0-9+&@#/%?=~_|!:,.;-]*)([A-Za-z0-9+&@#/%=~_|$]))"); // still needs to be improved for urls containing () such as wikipedia