don't include leading space in hashtag
This commit is contained in:
parent
507e4b6c6b
commit
fc67125854
1 changed files with 5 additions and 0 deletions
5
fun.go
5
fun.go
|
@ -123,6 +123,11 @@ var re_hashes = regexp.MustCompile(`(?:^|\W)#[[:alnum:]]+`)
|
|||
|
||||
func ontologies(s string) []string {
|
||||
m := re_hashes.FindAllString(s, -1)
|
||||
for i, h := range m {
|
||||
if h[0] != '#' {
|
||||
m[i] = h[1:]
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue