diff --git a/static/js/alert_words.js b/static/js/alert_words.js index 5d1f7da753..38b7a1d312 100644 --- a/static/js/alert_words.js +++ b/static/js/alert_words.js @@ -17,8 +17,8 @@ exports.process_message = function (message) { _.each(exports.words, function (word) { var clean = escape_user_regex(word); - var before_punctuation = '\\s|^|>|[\\(\\"]'; - var after_punctuation = '\\s|$|<|[\\)\\"\\?:.,]'; + var before_punctuation = '\\s|^|>|[\\(\\".,\';\\[]'; + var after_punctuation = '\\s|$|<|[\\)\\"\\?!:.,\';\\]!]'; var regex = new RegExp('(' + before_punctuation + ')' + '(' + clean + ')' + diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index 669fa3ae14..e97875883f 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -770,8 +770,8 @@ class AlertWordsNotificationProcessor(markdown.preprocessors.Preprocessor): realm_words = db_data['realm_alert_words'] content = '\n'.join(lines).lower() - allowed_before_punctuation = "|".join([r'\s', '^', r'[\(\"]']) - allowed_after_punctuation = "|".join([r'\s', '$', r'[\)\"\?:.,]']) + allowed_before_punctuation = "|".join([r'\s', '^', r'[\(\".,\';\[]']) + allowed_after_punctuation = "|".join([r'\s', '$', r'[\)\"\?:.,\';\]!]']) for user_id, words in realm_words.iteritems(): for word in words: