simplify tags
This commit is contained in:
parent
7686dfa474
commit
3c5be25cb3
6 changed files with 28 additions and 31 deletions
|
|
@ -28,11 +28,24 @@ type Tag struct {
|
|||
Regex string
|
||||
}
|
||||
|
||||
type Tags []Tag
|
||||
|
||||
type RTag struct {
|
||||
Name string
|
||||
Regex *regexp.Regexp
|
||||
}
|
||||
|
||||
type RTags []RTag
|
||||
|
||||
func (rt RTags) Match(text string) (found []string) {
|
||||
for _, t := range rt {
|
||||
if t.Regex.MatchString(text) {
|
||||
found = append(found, t.Name)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type Path struct {
|
||||
Name string
|
||||
Abs string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue