diff --git a/lib/CONST.d.ts b/lib/CONST.d.ts index af61d39a..1199ddba 100644 --- a/lib/CONST.d.ts +++ b/lib/CONST.d.ts @@ -251,10 +251,6 @@ export declare const CONST: { * Regex matching an text containing an email */ readonly EMAIL_PART: "([\\w\\-\\+\\'#]+(?:\\.[\\w\\-\\'\\+]+)*@(?:[\\w\\-]+\\.)+[a-z]{2,})"; - /** - * Regex matching a text containing an e164 format phone number - */ - readonly PHONE_PART: "\\+?[1-9]\\d{1,14}"; /** * Regular expression to check that a basic name is valid */ diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index 3da50ec7..9da0eb74 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -162,7 +162,7 @@ export default class ExpensiMark { */ { name: 'userMentions', - regex: new RegExp(`(@here|[a-zA-Z0-9.!$%&+=?^\`{|}-]?)(@${CONST.REG_EXP.EMAIL_PART}|@${CONST.REG_EXP.PHONE_PART})(?!((?:(?!|[^<]*(<\\/pre>|<\\/code>))`, 'gim'), + regex: new RegExp(`(@here|[a-zA-Z0-9.!$%&+=?^\`{|}-]?)(@${CONST.REG_EXP.EMAIL_PART})(?!((?:(?!|[^<]*(<\\/pre>|<\\/code>))`, 'gim'), replacement: (match, g1, g2) => { if (!Str.isValidMention(match)) { return match;