diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-07-28 10:10:44 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-07-28 10:10:44 -0400 |
commit | 892fe2b7b6b801e31dd23d74be14d68c989a4d12 (patch) | |
tree | 2785d6eb37fa6eb039611d3ec6c43c998ba8ee8d | |
parent | 1842868410ff13b46053f363eb22595faf9d2e7c (diff) | |
download | chat-892fe2b7b6b801e31dd23d74be14d68c989a4d12.tar.gz chat-892fe2b7b6b801e31dd23d74be14d68c989a4d12.tar.bz2 chat-892fe2b7b6b801e31dd23d74be14d68c989a4d12.zip |
Added non-capturing group to regex used for matching local file urls
-rw-r--r-- | model/utils.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/model/utils.go b/model/utils.go index 4c698be2a..c7f991da2 100644 --- a/model/utils.go +++ b/model/utils.go @@ -319,6 +319,6 @@ func ClearMentionTags(post string) string { } var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`) -var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(\.[A-Za-z0-9]{3,})?)`) +var PartialUrlRegex = regexp.MustCompile(`/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/((?:[A-Za-z0-9]{26})?.+(?:\.[A-Za-z0-9]{3,})?)`) var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true, '/': true, '\\': true} |