Skip to content

Commit

Permalink
Revert "Added support for phone mention without expensify.sms suffix "
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperhuangg authored Feb 13, 2024
1 parent 7aa1d42 commit 262ef18
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions lib/CONST.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/ExpensiMark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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})(?!((?:(?!<a).)+)?<\\/a>|[^<]*(<\\/pre>|<\\/code>))`, 'gim'),
regex: new RegExp(`(@here|[a-zA-Z0-9.!$%&+=?^\`{|}-]?)(@${CONST.REG_EXP.EMAIL_PART})(?!((?:(?!<a).)+)?<\\/a>|[^<]*(<\\/pre>|<\\/code>))`, 'gim'),
replacement: (match, g1, g2) => {
if (!Str.isValidMention(match)) {
return match;
Expand Down

0 comments on commit 262ef18

Please sign in to comment.