Use a perfect regex

react-query-api
Alex Gleason 2022-07-25 17:41:28 -05:00
rodzic 46de5efc69
commit 8cce389568
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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)));