From 8cce38956889c8fa5be3633a737307a07776a83f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 25 Jul 2022 17:41:28 -0500 Subject: [PATCH] Use a perfect regex --- app/soapbox/actions/compose.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/actions/compose.ts b/app/soapbox/actions/compose.ts index b24ac1d31..d2559c1f7 100644 --- a/app/soapbox/actions/compose.ts +++ b/app/soapbox/actions/compose.ts @@ -258,7 +258,7 @@ const submitCompose = (routerHistory: History, force = false) => return; } - const mentions: string[] | null = status.match(/(?:^|\s|\.)@([a-z0-9_]+(?:@[a-z0-9\.\-]+)?)/gi); // not a perfect regex + const mentions: string[] | null = status.match(/(?:^|\s)@([a-z\d_-]+(?:@[^@\s]+)?)/gi); if (mentions) { to = to.union(mentions.map(mention => mention.trim().slice(1)));