diff --git a/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php b/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php index 474b276a19..278444c0f7 100644 --- a/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php +++ b/src/infrastructure/markup/remarkup/markuprule/mention/PhabricatorRemarkupRuleMention.php @@ -27,17 +27,17 @@ final class PhabricatorRemarkupRuleMention const KEY_MENTIONED = 'phabricator.mentioned-user-phids'; + + // NOTE: Negative lookahead for period prevents us from picking up email + // addresses, while allowing constructs like "@tomo, lol". The negative + // lookbehind for a word character prevents us from matching "mail@lists" + // while allowing "@tomo/@mroch". The negative lookahead prevents us from + // matching "@joe.com" while allowing us to match "hey, @joe.". + const REGEX = '/(?