export const MENTION_REGEX = /@([a-z0-9_-]{3,30})/gi;

export function extractMentionedUsernames(content: string): string[] {
  const matches = content.matchAll(MENTION_REGEX);
  const usernames = new Set<string>();
  for (const m of matches) {
    const username = m[1];
    if (username) usernames.add(username.toLowerCase());
  }
  return [...usernames];
}
