Some more improvements for the tags/nicknames/groups regexp's
authorJulien Valroff <julien@kirya.net>
Tue, 29 Jun 2010 06:30:30 +0000 (08:30 +0200)
committerJulien Valroff <julien@kirya.net>
Tue, 29 Jun 2010 06:30:30 +0000 (08:30 +0200)
debian/patches/003_improve-regex.diff

index 57ceef4..776e5d4 100644 (file)
@@ -5,15 +5,17 @@ Forwarded: yes
 
 --- a/src/template.vala
 +++ b/src/template.vala
-@@ -60,9 +60,9 @@
+@@ -59,10 +59,10 @@
+               reload();
                
                //compile regex
-               nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
+-              nicks = new Regex("(^|\\s)@([A-Za-z0-9_]+)");
 -              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
-+              tags = new Regex("(^|\\s|['+&!/\\(-])#([A-Za-z0-9_.-\\p{Latin}\\p{Greek}]+)");
-+              groups = new Regex("(^|\\s|['+&!/\\(-])!([A-Za-z0-9_]+)"); //for identi.ca groups
++              nicks = new Regex("(^|\\s|['\"+&!/\\(-])@([A-Za-z0-9_]+)");
++              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("((https?|ftp)://([A-Za-z0-9+&@#/%?=~_|!:,.;-]*)([A-Za-z0-9+&@#/%=~_|$]))"); // still needs to be improved for urls containing () such as wikipedia's
                
                // characters must be cleared to know direction of text