diff --git a/lib/shared/account-utils.js b/lib/shared/account-utils.js --- a/lib/shared/account-utils.js +++ b/lib/shared/account-utils.js @@ -53,7 +53,6 @@ export { usernameMaxLength, - oldValidUsernameRegexString, validUsernameRegex, oldValidUsernameRegex, validEmailRegex, diff --git a/lib/shared/mention-utils.js b/lib/shared/mention-utils.js --- a/lib/shared/mention-utils.js +++ b/lib/shared/mention-utils.js @@ -2,7 +2,6 @@ import * as React from 'react'; -import { oldValidUsernameRegexString } from './account-utils.js'; import SentencePrefixSearchIndex from './sentence-prefix-search-index.js'; import { threadOtherMembers } from './thread-utils.js'; import { stringForUserExplicit } from './user-utils.js'; @@ -49,8 +48,9 @@ // The simple-markdown package already breaks words out for us, and we are // supposed to only match when the first word of the input matches +const markdownUserMentionRegexString = '[a-zA-Z0-9-_.]+'; const markdownUserMentionRegex: RegExp = new RegExp( - `^(@(${oldValidUsernameRegexString}))\\b`, + `^(@(${markdownUserMentionRegexString}))\\b`, ); function isUserMentioned(username: string, text: string): boolean { @@ -58,7 +58,7 @@ } const userMentionsExtractionRegex = new RegExp( - `\\B(@(${oldValidUsernameRegexString}))\\b`, + `\\B(@(${markdownUserMentionRegexString}))\\b`, 'g', );