ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [1/2] incubator-ponymail git commit: add a regex for catching URLs
Date Mon, 05 Sep 2016 08:02:35 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/coffee-and-cake 6fd100c06 -> 80707ed34


add a regex for catching URLs


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/567d7d85
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/567d7d85
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/567d7d85

Branch: refs/heads/coffee-and-cake
Commit: 567d7d8586baae3a214fd0c712ddb979443cbfc7
Parents: 6fd100c
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Mon Sep 5 09:57:27 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Mon Sep 5 09:57:27 2016 +0200

----------------------------------------------------------------------
 site/js/coffee/misc.coffee | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/567d7d85/site/js/coffee/misc.coffee
----------------------------------------------------------------------
diff --git a/site/js/coffee/misc.coffee b/site/js/coffee/misc.coffee
index 3bbcbc0..e8cedec 100644
--- a/site/js/coffee/misc.coffee
+++ b/site/js/coffee/misc.coffee
@@ -72,3 +72,20 @@ Array.prototype.remove = (val) ->
             return this
     return this;
 
+ponymail_url_regex = new RegExp(
+  "(" +
+    "(?:(?:[a-z]+)://)" +
+    "(?:\\S+(?::\\S*)?@)?" +
+    "(?:" +
+    "([01][0-9][0-9]|2[0-4][0-9]|25[0-5])" +
+    "|" +
+      "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" +
+      "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" +
+      "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))" +
+      "\\.?" +
+    ")" +
+    "(?::\\d{2,5})?" +
+    "(?:[/?#]([^,<>()\\[\\] \\t\\r\\n]|(<[^:\\s]*?>|\\([^:\\s]*?\\)|\\[[^:\\s]*?\\]))*)?"
+
+    ")\\.?"
+  , "mi"
+)
\ No newline at end of file


Mime
View raw message