gosuki/parse.go

27 lines
429 B
Go
Raw Normal View History

2017-10-20 10:51:56 +00:00
package main
import (
"regexp"
2017-10-20 10:51:56 +00:00
)
const (
RE_TAGS = `\B#\w+`
)
2017-10-20 10:51:56 +00:00
2017-11-20 15:05:44 +00:00
type ParserStats struct {
2017-11-17 18:06:34 +00:00
lastNodeCount int
2017-11-20 15:05:44 +00:00
lastURLCount int
2017-11-17 18:06:34 +00:00
currentNodeCount int
currentUrlCount int
}
2017-10-20 10:51:56 +00:00
func _s(value interface{}) string {
return string(value.([]byte))
}
2017-10-20 10:51:56 +00:00
func findTagsInTitle(title []byte) {
var regex = regexp.MustCompile(RE_TAGS)
tags := regex.FindAll(title, -1)
debugPrint("%s ---> found following tags: %s", title, tags)
}