From 219c6ec1d0a93b5ef67c8dadbd9ce2df944ab6a9 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 29 Jan 2018 01:41:23 +0100 Subject: [PATCH] fixed regex (\b matches non-ascii letters) --- CMakeLists.txt | 2 +- src/rss2mastodon.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfa931a..d742795 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7) include(GNUInstallDirs) project (rss2mastodon - VERSION 0.1.5 + VERSION 0.1.6 LANGUAGES CXX ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall") diff --git a/src/rss2mastodon.cpp b/src/rss2mastodon.cpp index a5ed123..a79a9e5 100644 --- a/src/rss2mastodon.cpp +++ b/src/rss2mastodon.cpp @@ -143,7 +143,7 @@ std::vector parse_website(const string &profile, const string &xml) for (const string &hashtag : watchwords) { - std::regex rehashtag("\\b(" + hashtag + ")\\b", + std::regex rehashtag("[[:space:][:punct:]](" + hashtag + ")[[:space:][:punct:]]", std::regex_constants::icase); str = std::regex_replace(str, rehashtag, "#$1", std::regex_constants::format_first_only);