fixed regex (\b matches non-ascii letters)
This commit is contained in:
parent
e3823d02f5
commit
219c6ec1d0
|
@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
project (rss2mastodon
|
project (rss2mastodon
|
||||||
VERSION 0.1.5
|
VERSION 0.1.6
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall")
|
||||||
|
|
|
@ -143,7 +143,7 @@ std::vector<string> parse_website(const string &profile, const string &xml)
|
||||||
|
|
||||||
for (const string &hashtag : watchwords)
|
for (const string &hashtag : watchwords)
|
||||||
{
|
{
|
||||||
std::regex rehashtag("\\b(" + hashtag + ")\\b",
|
std::regex rehashtag("[[:space:][:punct:]](" + hashtag + ")[[:space:][:punct:]]",
|
||||||
std::regex_constants::icase);
|
std::regex_constants::icase);
|
||||||
str = std::regex_replace(str, rehashtag, "#$1",
|
str = std::regex_replace(str, rehashtag, "#$1",
|
||||||
std::regex_constants::format_first_only);
|
std::regex_constants::format_first_only);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user