From dcc07fab759af29c8c5cea8d240ad48d66d72cb2 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 29 Dec 2019 08:56:27 +0100 Subject: [PATCH] Refine hashtag-regex. --- src/document.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/document.cpp b/src/document.cpp index 038e134..708ff8a 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -244,8 +244,8 @@ string Document::add_hashtags(const string &text) string out{text}; for (const auto &tag : _watchwords) { - regex re_tag("([[:space:][:punct:]-\u200b]|^)(" - + tag + ")([[:space:][:punct:]-\u200b]|$)", regex::icase); + regex re_tag("([[:space:]\u200b]|^)(" + + tag + ")([[:space:]\u200b[:punct:]]|$)", regex::icase); out = regex_replace(out, re_tag, "$1#$2$3", boost::format_first_only); }