more work on parsing statuses

This commit is contained in:
tsmethurst 2021-05-12 17:31:48 +02:00
commit 884d0ecc8f
9 changed files with 251 additions and 32 deletions

View file

@ -35,6 +35,9 @@ const (
)
var (
mentionNameRegexString = `@([a-zA-Z0-9_]+)(?:@([a-zA-Z0-9_\-\.]+)?)`
mentionNameRegex = regexp.MustCompile(fmt.Sprintf(`^%s$`, mentionNameRegexString))
// mention regex can be played around with here: https://regex101.com/r/qwM9D3/1
mentionFinderRegexString = `(?: |^|\W)(@[a-zA-Z0-9_]+(?:@[a-zA-Z0-9_\-\.]+)?)(?: |\n)`
mentionFinderRegex = regexp.MustCompile(mentionFinderRegexString)