From b660acf8f893972c56817cfa49e8318f40aa32a0 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 11 Dec 2015 13:03:14 -0500 Subject: Add hashtag testing and allow special german characters --- model/utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'model/utils.go') diff --git a/model/utils.go b/model/utils.go index 5596b06ff..617c95efd 100644 --- a/model/utils.go +++ b/model/utils.go @@ -273,9 +273,9 @@ func Etag(parts ...interface{}) string { return etag } -var validHashtag = regexp.MustCompile(`^(#[A-Za-z]+[A-Za-z0-9_\-]*[A-Za-z0-9])$`) -var puncStart = regexp.MustCompile(`^[.,()&$!\[\]{}':;\\]+`) -var puncEnd = regexp.MustCompile(`[.,()&$#!\[\]{}';\\]+$`) +var validHashtag = regexp.MustCompile(`^(#[A-Za-zäöüÄÖÜß]+[A-Za-z0-9äöüÄÖÜß_\-]*[A-Za-z0-9äöüÄÖÜß])$`) +var puncStart = regexp.MustCompile(`^[.,()&$!\?\[\]{}':;\\]+`) +var puncEnd = regexp.MustCompile(`[.,()&$#!\?\[\]{}';\\]+$`) func ParseHashtags(text string) (string, string) { words := strings.Fields(text) -- cgit v1.2.3-1-g7c22