Add hashtag testing and allow special german characters

Этот коммит содержится в:
JoramWilander
2015-12-11 13:03:14 -05:00
родитель ce03fbc6d8
Коммит b660acf8f8
4 изменённых файлов: 48 добавлений и 4 удалений

Просмотреть файл

@@ -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)