mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-28 06:03:32 -06:00
mention regex better but not 100% there
This commit is contained in:
parent
197ef03ead
commit
c85c63680d
7 changed files with 50 additions and 12 deletions
|
|
@ -41,7 +41,7 @@ var (
|
|||
mentionNameRegex = regexp.MustCompile(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)`
|
||||
mentionFinderRegexString = `(?: |^|\W)(@[a-zA-Z0-9_]+(?:@[a-zA-Z0-9_\-\.]+)?)(?:[^a-zA-Z0-9]|\W)`
|
||||
mentionFinderRegex = regexp.MustCompile(mentionFinderRegexString)
|
||||
|
||||
// hashtag regex can be played with here: https://regex101.com/r/Vhy8pg/1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue