aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-11-25 17:19:55 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-11-25 17:19:55 +0800
commit12924ec3e9b06460c5ec6ccb5e84a58ab64cd762 (patch)
tree6caacd20aea2200d87463a50575c12bb2bfe112b
parentfe57de44b370951c5e0a5de0aa78e0bb0fca9849 (diff)
downloadgsoc2013-empathy-12924ec3e9b06460c5ec6ccb5e84a58ab64cd762.tar
gsoc2013-empathy-12924ec3e9b06460c5ec6ccb5e84a58ab64cd762.tar.gz
gsoc2013-empathy-12924ec3e9b06460c5ec6ccb5e84a58ab64cd762.tar.bz2
gsoc2013-empathy-12924ec3e9b06460c5ec6ccb5e84a58ab64cd762.tar.lz
gsoc2013-empathy-12924ec3e9b06460c5ec6ccb5e84a58ab64cd762.tar.xz
gsoc2013-empathy-12924ec3e9b06460c5ec6ccb5e84a58ab64cd762.tar.zst
gsoc2013-empathy-12924ec3e9b06460c5ec6ccb5e84a58ab64cd762.zip
Rework the link regex to have "(user@server.com)" case work.
-rw-r--r--libempathy-gtk/empathy-ui-utils.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index f57468628..c737873d1 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -50,13 +50,15 @@
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-ft-factory.h>
-#define SCHEMES "([a-zA-Z\\+]+)"
-#define BODY_CHAR "[^\\ \\n\"\']"
-#define BODY "("BODY_CHAR"+)"
-#define END_BODY "("BODY_CHAR"*[^,;\\:\?><(){}\\[\\]\\ \"\'\\.\\n])"
-#define URI_REGEX "("SCHEMES"://"END_BODY")" \
- "|((mailto:)?"BODY"@"BODY"\\."END_BODY")"\
- "|((www|ftp)\\."END_BODY")"
+#define SCHEMES "([a-zA-Z\\+]+)"
+#define INVALID_CHARS " \n\"'"
+#define INVALID_CHARS_EXT INVALID_CHARS "\\[\\]<>(){},;:?"
+#define BODY "([^"INVALID_CHARS"]+)"
+#define BODY_END "([^"INVALID_CHARS"]*)[^"INVALID_CHARS_EXT".]"
+#define BODY_STRICT "([^"INVALID_CHARS_EXT"]+)"
+#define URI_REGEX "("SCHEMES"://"BODY_END")" \
+ "|((www|ftp)\\."BODY_END")" \
+ "|((mailto:)?"BODY_STRICT"@"BODY"\\."BODY_END")"
void
empathy_gtk_init (void)