* Add Korean character ranges to exist CJK pattern

* Add constant for CJK hashtags
Becuase most of keywords in CJK are two characters

* Add CJK ranges to hashtag pattern to handle it.

* Fixes hashtag pattern to apply numbers at last

* Remove a wrong test case
`test_` shouldn't be a hashtag

* Fix hashtag regex to support standard unicodes

* Remove wrong escapes from regex
Этот коммит содержится в:
Hyeseong Kim
2016-11-24 23:38:56 +09:00
коммит произвёл Joram Wilander
родитель 981ea33b8e
Коммит 2abcc25173
3 изменённых файлов: 3 добавлений и 9 удалений

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

@@ -304,7 +304,7 @@ func Etag(parts ...interface{}) string {
return etag
}
var validHashtag = regexp.MustCompile(`^(#[A-Za-zäöüÄÖÜß]+[A-Za-z0-9äöüÄÖÜß_\-]*[A-Za-z0-9äöüÄÖÜß])$`)
var validHashtag = regexp.MustCompile(`^(#\pL[\pL\d\-_.]*[\pL\d])$`)
var puncStart = regexp.MustCompile(`^[^\pL\d\s#]+`)
var hashtagStart = regexp.MustCompile(`^#{2,}`)
var puncEnd = regexp.MustCompile(`[^\pL\d\s]+$`)