[empathy] Rework the link regex to have "(user server com)" case work.
- From: Xavier Claessens <xclaesse src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] Rework the link regex to have "(user server com)" case work.
- Date: Thu, 26 Nov 2009 09:21:13 +0000 (UTC)
commit 12924ec3e9b06460c5ec6ccb5e84a58ab64cd762
Author: Xavier Claessens <xclaesse gmail com>
Date: Wed Nov 25 10:19:55 2009 +0100
Rework the link regex to have "(user server com)" case work.
libempathy-gtk/empathy-ui-utils.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index f574686..c737873 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]