Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
github.com/yesnault/hashtag
Package hashtag implements extraction of Twitter type hashtags, mentions and replies form text in Go. This package partially ports extraction routines from Twitter's official Java package to Go and runs most of the standard twitter-text conformance tests. It does not yet implement URL extraction (and hence URL/Hashtag overlaps), cashtags and lists
Since the package attempts to closely follow the Twitter-Text Java API, function names may be longer than typical Go package function names
Note: As the package matures, I plan to move this to gopkg.in
go get github.com/srinathh/hashtag
Import the package as
import "github.com/srinathh/hashtag"
This package supports the following functions to extract hashtags and mentions with or without position markers. The functions omit # and @ characters (and also their higher unicode number counterparts @ and #) from return values
ExtractHashtags(text string) []string
ExtractHashtagsWithIndices(text string) []Entity
ExtractMentions(text string) []string
ExtractMentionsWithIndices(text string) []Entity
ExtractReply(text string) string
Read the full documentation and examples on GoDoc
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.