diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-06-19 08:25:47 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-06-19 08:25:47 -0400 |
commit | 09c4089c95ed8f4306f0005918677bdbaa18a486 (patch) | |
tree | f379d018fd1107d0678d3cddaee0db2d93c47845 /model/utils.go | |
parent | 6051b01cdfbf426a6d069aa57cb612c1813a8c3f (diff) | |
download | chat-09c4089c95ed8f4306f0005918677bdbaa18a486.tar.gz chat-09c4089c95ed8f4306f0005918677bdbaa18a486.tar.bz2 chat-09c4089c95ed8f4306f0005918677bdbaa18a486.zip |
improved split function
Diffstat (limited to 'model/utils.go')
-rw-r--r-- | model/utils.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/model/utils.go b/model/utils.go index 2541247de..9f1788699 100644 --- a/model/utils.go +++ b/model/utils.go @@ -319,3 +319,5 @@ 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(`/api/v1/files/(get|get_image)/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/(([A-Za-z0-9]+/)?.+\.[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} |