From 4c4d09992e9d80a6fe6a914fb0c20055b08700fe Mon Sep 17 00:00:00 2001 From: Viktar Lukashonak Date: Sat, 10 Dec 2022 18:36:58 +0300 Subject: [PATCH] Regular expression improved --- src/modules/clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/clock.cpp b/src/modules/clock.cpp index 910637b6..776ae11b 100644 --- a/src/modules/clock.cpp +++ b/src/modules/clock.cpp @@ -80,7 +80,7 @@ waybar::modules::Clock::Clock(const std::string& id, const Json::Value& config) std::regex_replace(config_["format-calendar-weeks"].asString(), std::regex("\\{\\}"), (first_day_of_week() == date::Monday) ? "{:%V}" : "{:%U}"); weeks_format_left_gaps = - std::regex_replace(weeks_format_, std::regex(".*|.*|\\{.?+\\}"), "").length(); + std::regex_replace(weeks_format_, std::regex("]+>|\\{.*\\}"), "").length(); } else { weeks_format_ = ""; }