mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 01:22:24 -05:00
more work on parsing statuses
This commit is contained in:
parent
77736b926b
commit
884d0ecc8f
9 changed files with 251 additions and 32 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue