From cc48294c31a76e94fa879ad0d8d5dbd7e94c651b Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 15 May 2021 11:58:11 +0200 Subject: Inbox post (#22) Inbox POST from federated servers now working for statuses and follow requests. Follow request client API added. Start work on federating outgoing messages. Other fixes and changes/tidying up. --- internal/util/regexes.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/util/regexes.go') diff --git a/internal/util/regexes.go b/internal/util/regexes.go index a59bd678a..adab8c87f 100644 --- a/internal/util/regexes.go +++ b/internal/util/regexes.go @@ -35,6 +35,11 @@ const ( ) var ( + mentionNameRegexString = `^@([a-zA-Z0-9_]+)(?:@([a-zA-Z0-9_\-\.]+)?)$` + // mention name regex captures the username and domain part from a mention string + // such as @whatever_user@example.org, returning whatever_user and example.org (without the @ symbols) + 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)` mentionFinderRegex = regexp.MustCompile(mentionFinderRegexString) -- cgit v1.2.3