Change back to previous search regex
authorJulien Valroff <julien@kirya.net>
Mon, 31 May 2010 18:23:05 +0000 (20:23 +0200)
committerJulien Valroff <julien@kirya.net>
Mon, 31 May 2010 18:23:05 +0000 (20:23 +0200)
debian/patches/003_fix-search-regex.diff
debian/patches/006_improve-url-regex.diff

index 7ad4cc9..c9eec50 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}]+)");
-+              tags = new Regex("#([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
                
@@ -19,7 +19,7 @@ Forwarded: yes
                
                result = nicks.replace(result, -1, 0, "\\1@<a class='re_nick' href='userinfo://\\2'>\\2</a>");
 -              result = tags.replace(result, -1, 0, "<a class='tags' href='%s\\1'>\\1</a>".printf(search_url));
-+              result = tags.replace(result, -1, 0, "#<a class='tags' href='%s\\1'>\\1</a>".printf(search_url));
++              result = tags.replace(result, -1, 0, "\\1#<a class='tags' href='%s\\2'>\\2</a>".printf(search_url));
                
                if(service == "identi.ca") //for identi.ca only
                        result = groups.replace(result, -1, 0, "\\1!<a class='tags' href='http://identi.ca/group/\\2'>\\2</a>");
index a7ec75d..a6c1520 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_]+)");
-               tags = new Regex("#([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